diff options
author | A-Team <ateam@pad.test.qt.nokia.com> | 2010-10-30 22:00:11 (GMT) |
---|---|---|
committer | A-Team <ateam@pad.test.qt.nokia.com> | 2010-10-30 22:00:11 (GMT) |
commit | 98d8eeabea4b6c0da01380cec30fc6da5619be2e (patch) | |
tree | ca249fbefa4d172f4f35788d8a786590cd40e830 /src | |
parent | 69df8210d4c2a144e7e2da43abb11e3ddb524265 (diff) | |
parent | 349b6c734aa7af85f3709312325c3b2e9abdad2b (diff) | |
download | Qt-98d8eeabea4b6c0da01380cec30fc6da5619be2e.zip Qt-98d8eeabea4b6c0da01380cec30fc6da5619be2e.tar.gz Qt-98d8eeabea4b6c0da01380cec30fc6da5619be2e.tar.bz2 |
Merge branch '4.7-upstream' into 4.7-doc
Diffstat (limited to 'src')
-rw-r--r-- | src/corelib/io/qsettings.cpp | 21 | ||||
-rw-r--r-- | src/gui/painting/qpaintengine_raster.cpp | 3 | ||||
-rw-r--r-- | src/plugins/bearer/connman/qconnmanservice_linux.cpp | 8 |
3 files changed, 20 insertions, 12 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/gui/painting/qpaintengine_raster.cpp b/src/gui/painting/qpaintengine_raster.cpp index 8f9d8ba..3717ed9 100644 --- a/src/gui/painting/qpaintengine_raster.cpp +++ b/src/gui/painting/qpaintengine_raster.cpp @@ -40,6 +40,7 @@ ****************************************************************************/ #include <QtCore/qglobal.h> +#include <QtCore/qmutex.h> #define QT_FT_BEGIN_HEADER #define QT_FT_END_HEADER @@ -4946,6 +4947,7 @@ public: for (int i = 0; i < stops.size() && i <= 2; i++) hash_val += stops[i].second.rgba(); + QMutexLocker lock(&mutex); QGradientColorTableHash::const_iterator it = cache.constFind(hash_val); if (it == cache.constEnd()) @@ -4979,6 +4981,7 @@ protected: } QGradientColorTableHash cache; + QMutex mutex; }; void QGradientCache::generateGradientColorTable(const QGradient& gradient, uint *colorTable, int size, int opacity) const diff --git a/src/plugins/bearer/connman/qconnmanservice_linux.cpp b/src/plugins/bearer/connman/qconnmanservice_linux.cpp index 46b6e80..952a444 100644 --- a/src/plugins/bearer/connman/qconnmanservice_linux.cpp +++ b/src/plugins/bearer/connman/qconnmanservice_linux.cpp @@ -79,7 +79,7 @@ if (QLatin1String(signal) == SIGNAL(propertyChanged(QString,QDBusVariant))) { QLatin1String(CONNMAN_MANAGER_PATH), QLatin1String(CONNMAN_MANAGER_INTERFACE), QLatin1String("PropertyChanged"), - this,SIGNAL(propertyChanged(const QString &, const QDBusVariant & ))), Qt::UniqueConnection) { + this,SIGNAL(propertyChanged(const QString &, const QDBusVariant & )))) { qWarning() << "PropertyCHanged not connected"; } } @@ -89,7 +89,7 @@ if (QLatin1String(signal) == SIGNAL(propertyChanged(QString,QDBusVariant))) { QLatin1String(CONNMAN_MANAGER_PATH), QLatin1String(CONNMAN_MANAGER_INTERFACE), QLatin1String("StateChanged"), - this,SIGNAL(stateChanged(const QString&))), Qt::UniqueConnection) { + this,SIGNAL(stateChanged(const QString&)))) { qWarning() << "StateChanged not connected"; } @@ -338,7 +338,7 @@ void QConnmanNetworkInterface::connectNotify(const char *signal) this->path(), QLatin1String(CONNMAN_NETWORK_INTERFACE), QLatin1String("PropertyChanged"), - this,SIGNAL(propertyChanged(QString,QDBusVariant))), Qt::UniqueConnection) { + this,SIGNAL(propertyChanged(QString,QDBusVariant)))) { qWarning() << "network properties not connected"; } } @@ -350,7 +350,7 @@ void QConnmanNetworkInterface::connectNotify(const char *signal) this->path(), QLatin1String(CONNMAN_NETWORK_INTERFACE), QLatin1String("PropertyChanged"), - helper,SLOT(propertyChanged(QString,QDBusVariant))), Qt::UniqueConnection; + helper,SLOT(propertyChanged(QString,QDBusVariant))); QObject::connect(helper,SIGNAL(propertyChangedContext(const QString &,const QString &,const QDBusVariant &)), this,SIGNAL(propertyChangedContext(const QString &,const QString &,const QDBusVariant &)), Qt::UniqueConnection); |