Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
~QTextCodecCleanup();
};
+static bool removecodecs = true;
/*
Deletes all the created codecs. This destructor is called just
before exiting to delete any QTextCodec objects that may be lying
*/
QTextCodecCleanup::~QTextCodecCleanup()
{
- while (begin() != end()) {
- delete *begin();
+ removecodecs = false;
+ while (!isEmpty()) {
+ delete takeLast();
}
localeMapper = nullptr;
#ifndef QT_NO_DEBUG
*/
QTextCodec::~QTextCodec()
{
+ if (removecodecs) {
#ifndef QT_NO_THREAD
- QMutexLocker locker(textCodecsMutex());
+ QMutexLocker locker(textCodecsMutex());
#endif
- qGlobalQTextCodec()->removeAll(this);
+ qGlobalQTextCodec()->removeAll(this);
+ }
}
/*!