From 03ab94b0e7a549bcf839639438f782a47522ffa7 Mon Sep 17 00:00:00 2001 From: Igor Mironchik Date: Thu, 24 May 2018 15:59:23 +0300 Subject: Deregister QTextCodec on destruction QTextCodec automatically deregisters on destruction now. [ChangeLog][QtCore][QTextCodec] QTextCodec automatically deregisters on destruction now. Task-number: QTBUG-56203 Change-Id: Ic9a66c512642c9913aa27ea5167b9f7341e7f0fe Reviewed-by: Thiago Macieira --- src/corelib/kernel/qcoreglobaldata.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/corelib/kernel/qcoreglobaldata.cpp') diff --git a/src/corelib/kernel/qcoreglobaldata.cpp b/src/corelib/kernel/qcoreglobaldata.cpp index e2087b9e64..88a45ef4ee 100644 --- a/src/corelib/kernel/qcoreglobaldata.cpp +++ b/src/corelib/kernel/qcoreglobaldata.cpp @@ -55,7 +55,10 @@ QCoreGlobalData::~QCoreGlobalData() { #if QT_CONFIG(textcodec) codecForLocale = 0; - for (QList::const_iterator it = allCodecs.constBegin(); it != allCodecs.constEnd(); ++it) + QList tmp = allCodecs; + allCodecs.clear(); + codecCache.clear(); + for (QList::const_iterator it = tmp.constBegin(); it != tmp.constEnd(); ++it) delete *it; #endif } -- cgit v1.2.3