summaryrefslogtreecommitdiffstats
path: root/src/corelib/kernel/qcoreglobaldata.cpp
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@nokia.com>2012-07-20 10:00:52 +0200
committerQt by Nokia <qt-info@nokia.com>2012-07-31 11:11:43 +0200
commit5af9ecafd9c14f39bec5fed3192a266ec9e31ffe (patch)
tree5b057af18521a688f99ccde68f214a9cca492f6f /src/corelib/kernel/qcoreglobaldata.cpp
parent920dcb0158e191f0eadf4bec0645348cfb6e9619 (diff)
Move the text codec list to qcoreglobaldata.
This removes some global statics in QTextCodec and makes the code better to maintain in the longer term. Remove QT_NO_THREAD defines around mutexes as this isn't required in Qt 5 anymore. Change-Id: I15ede75f53b16f134f4053f3188c4b47e86fcd8a Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/kernel/qcoreglobaldata.cpp')
-rw-r--r--src/corelib/kernel/qcoreglobaldata.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/corelib/kernel/qcoreglobaldata.cpp b/src/corelib/kernel/qcoreglobaldata.cpp
index d8ffcaae48..7d06f0e392 100644
--- a/src/corelib/kernel/qcoreglobaldata.cpp
+++ b/src/corelib/kernel/qcoreglobaldata.cpp
@@ -40,11 +40,24 @@
****************************************************************************/
#include "qcoreglobaldata_p.h"
+#include "qtextcodec.h"
QT_BEGIN_NAMESPACE
Q_GLOBAL_STATIC(QCoreGlobalData, globalInstance)
+QCoreGlobalData::QCoreGlobalData()
+ : codecForLocale(0)
+{
+}
+
+QCoreGlobalData::~QCoreGlobalData()
+{
+ codecForLocale = 0;
+ for (QList<QTextCodec *>::const_iterator it = allCodecs.constBegin(); it != allCodecs.constEnd(); ++it)
+ delete *it;
+}
+
QCoreGlobalData *QCoreGlobalData::instance()
{
return globalInstance();