diff options
Diffstat (limited to 'src/gui/image/qpixmapcache.cpp')
-rw-r--r-- | src/gui/image/qpixmapcache.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/gui/image/qpixmapcache.cpp b/src/gui/image/qpixmapcache.cpp index bdcddfd..59c8ce7 100644 --- a/src/gui/image/qpixmapcache.cpp +++ b/src/gui/image/qpixmapcache.cpp @@ -87,7 +87,9 @@ QT_BEGIN_NAMESPACE \sa QCache, QPixmap */ -#if defined(Q_WS_QWS) || defined(Q_WS_WINCE) +#if defined(Q_OS_SYMBIAN) +static int cache_limit = 1024; // 1048 KB cache limit for symbian +#elif defined(Q_WS_QWS) || defined(Q_WS_WINCE) static int cache_limit = 2048; // 2048 KB cache limit for embedded #else static int cache_limit = 10240; // 10 MB cache limit for desktop @@ -597,7 +599,12 @@ void QPixmapCache::remove(const Key &key) void QPixmapCache::clear() { - pm_cache()->clear(); + QT_TRY { + pm_cache()->clear(); + } QT_CATCH(const std::bad_alloc &) { + // if we ran out of memory during pm_cache(), it's no leak, + // so just ignore it. + } } QT_END_NAMESPACE |