diff --git a/qt4/src/poppler-document.cc b/qt4/src/poppler-document.cc
index 04c56c6..d1d45d9 100644
--- a/qt4/src/poppler-document.cc
+++ b/qt4/src/poppler-document.cc
@@ -46,6 +46,7 @@
 namespace Poppler {
 
   int DocumentData::count = 0;
+  GBool DocumentData::ownGlobalParams = gFalse;
 
   Document *Document::load(const QString &filePath, const QByteArray &ownerPassword,
 			   const QByteArray &userPassword)
diff --git a/qt4/src/poppler-private.cc b/qt4/src/poppler-private.cc
index d6e3265..075b3fd 100644
--- a/qt4/src/poppler-private.cc
+++ b/qt4/src/poppler-private.cc
@@ -234,8 +234,13 @@ namespace Debug {
         count --;
         if ( count == 0 )
         {
-            utf8Map = 0;
-            delete globalParams;
+            if ( ownGlobalParams )
+            {
+                utf8Map = 0;
+                delete globalParams;
+                globalParams = NULL;
+                ownGlobalParams = gFalse;
+            }
         }
       }
     
@@ -253,8 +258,12 @@ namespace Debug {
       
         if ( count == 0 )
         {
-            utf8Map = 0;
-            globalParams = new GlobalParams();
+            if ( !globalParams )
+            {
+                utf8Map = 0;
+                globalParams = new GlobalParams();
+                ownGlobalParams = gTrue;
+            }
             setErrorFunction(qt4ErrorFunction);
         }
         count ++;
diff --git a/qt4/src/poppler-private.h b/qt4/src/poppler-private.h
index 7d0b1a3..9614e38 100644
--- a/qt4/src/poppler-private.h
+++ b/qt4/src/poppler-private.h
@@ -177,6 +177,7 @@ namespace Poppler {
 	QColor paperColor;
 	int m_hints;
 	static int count;
+	static GBool ownGlobalParams;
     };
 
     class FontInfoData
