diff options
Diffstat (limited to 'src/corelib')
-rw-r--r-- | src/corelib/io/qsettings.cpp | 21 | ||||
-rw-r--r-- | src/corelib/kernel/qmimedata.cpp | 2 | ||||
-rw-r--r-- | src/corelib/statemachine/qstatemachine.cpp | 2 |
3 files changed, 15 insertions, 10 deletions
diff --git a/src/corelib/io/qsettings.cpp b/src/corelib/io/qsettings.cpp index 53af822..8ee42e7 100644 --- a/src/corelib/io/qsettings.cpp +++ b/src/corelib/io/qsettings.cpp @@ -1231,16 +1231,21 @@ QConfFileSettingsPrivate::~QConfFileSettingsPrivate() if (confFiles[i] && !confFiles[i]->ref.deref()) { if (confFiles[i]->size == 0) { delete confFiles[i].take(); - } else if (unusedCache) { + } else { if (usedHash) usedHash->remove(confFiles[i]->name); - QT_TRY { - // compute a better size? - unusedCache->insert(confFiles[i]->name, confFiles[i].data(), - 10 + (confFiles[i]->originalKeys.size() / 4)); - confFiles[i].take(); - } QT_CATCH(...) { - // out of memory. Do not cache the file. + if (unusedCache) { + QT_TRY { + // compute a better size? + unusedCache->insert(confFiles[i]->name, confFiles[i].data(), + 10 + (confFiles[i]->originalKeys.size() / 4)); + confFiles[i].take(); + } QT_CATCH(...) { + // out of memory. Do not cache the file. + delete confFiles[i].take(); + } + } else { + // unusedCache is gone - delete the entry to prevent a memory leak delete confFiles[i].take(); } } diff --git a/src/corelib/kernel/qmimedata.cpp b/src/corelib/kernel/qmimedata.cpp index bf4001a..899ca7b 100644 --- a/src/corelib/kernel/qmimedata.cpp +++ b/src/corelib/kernel/qmimedata.cpp @@ -249,7 +249,7 @@ QVariant QMimeDataPrivate::retrieveTypedData(const QString &format, QVariant::Ty \o We can subclass QMimeData and reimplement hasFormat(), formats(), and retrieveData(). - \o If the drag and drop operation occurs withing a single + \o If the drag and drop operation occurs within a single application, we can subclass QMimeData and add extra data in it, and use a qobject_cast() in the receiver's drop event handler. For example: diff --git a/src/corelib/statemachine/qstatemachine.cpp b/src/corelib/statemachine/qstatemachine.cpp index 4b371f7..6324cc9 100644 --- a/src/corelib/statemachine/qstatemachine.cpp +++ b/src/corelib/statemachine/qstatemachine.cpp @@ -178,7 +178,7 @@ QT_BEGIN_NAMESPACE QStateMachinePrivate::QStateMachinePrivate() { - QAbstractStatePrivate::isMachine = true; + isMachine = true; state = NotRunning; _startState = 0; |