summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlbert Astals Cid <aacid@kde.org>2011-01-28 20:34:08 +0000
committerAlbert Astals Cid <aacid@kde.org>2011-01-28 20:35:49 +0000
commit64e157c7acc921b7acccc1046fbbf9232bf0b74c (patch)
tree8a0115323b941e12259de53801a8b8022e2e7b9b
parent301a07c4c303e16c537090563cefb7d6f867977b (diff)
Make sure uMap is still valid before using it
Fixes KDE bug 264667
-rw-r--r--qt4/src/poppler-private.cc6
1 files changed, 4 insertions, 2 deletions
diff --git a/qt4/src/poppler-private.cc b/qt4/src/poppler-private.cc
index da19e987..253222ec 100644
--- a/qt4/src/poppler-private.cc
+++ b/qt4/src/poppler-private.cc
@@ -1,6 +1,6 @@
/* poppler-private.cc: qt interface to poppler
* Copyright (C) 2005, Net Integration Technologies, Inc.
- * Copyright (C) 2006 by Albert Astals Cid <aacid@kde.org>
+ * Copyright (C) 2006, 2011 by Albert Astals Cid <aacid@kde.org>
* Copyright (C) 2008, 2010, 2011 by Pino Toscano <pino@kde.org>
* Inspired on code by
* Copyright (C) 2004 by Albert Astals Cid <tsdgeos@terra.es>
@@ -71,11 +71,13 @@ namespace Debug {
QString unicodeToQString(Unicode* u, int len) {
static UnicodeMap *uMap = 0;
- if (!uMap)
+ static GlobalParams *gParams = globalParams;
+ if (!uMap || gParams != globalParams)
{
GooString enc("UTF-8");
uMap = globalParams->getUnicodeMap(&enc);
uMap->incRefCnt();
+ gParams = globalParams;
}
// ignore the last character if it is 0x0