diff options
author | Harald Fernengel <harald@trolltech.com> | 2009-08-14 08:34:51 (GMT) |
---|---|---|
committer | Harald Fernengel <harald@trolltech.com> | 2009-08-14 08:36:45 (GMT) |
commit | 5fe78207f44dbbf5c96560e69493653af55455a7 (patch) | |
tree | 2a00622c1b63d65b62b31375acc8c50e7ed50c89 /src/gui/image | |
parent | 6b1724337bf0e7b47a87a6b65d04e9967cc47db6 (diff) | |
download | Qt-5fe78207f44dbbf5c96560e69493653af55455a7.zip Qt-5fe78207f44dbbf5c96560e69493653af55455a7.tar.gz Qt-5fe78207f44dbbf5c96560e69493653af55455a7.tar.bz2 |
Partially revert oom safety fixes
Turns out it's way too much work to make all the Pixmap backends
strongly exception safe. Bumped to "future Qt version" :)
Diffstat (limited to 'src/gui/image')
-rw-r--r-- | src/gui/image/qpixmap.cpp | 27 |
1 files changed, 9 insertions, 18 deletions
diff --git a/src/gui/image/qpixmap.cpp b/src/gui/image/qpixmap.cpp index 93077d7..8259c6f 100644 --- a/src/gui/image/qpixmap.cpp +++ b/src/gui/image/qpixmap.cpp @@ -854,14 +854,10 @@ bool QPixmap::load(const QString &fileName, const char *format, Qt::ImageConvers return false; QPixmap pm; - QT_TRY { - if (data->pixelType() == QPixmapData::BitmapType) - pm = QBitmap::fromImage(image, flags); - else - pm = fromImage(image, flags); - } QT_CATCH (const std::bad_alloc &) { - // swallow bad allocs and leave pm a null pixmap - } + if (data->pixelType() == QPixmapData::BitmapType) + pm = QBitmap::fromImage(image, flags); + else + pm = fromImage(image, flags); if (!pm.isNull()) { *this = pm; QPixmapCache::insert(key, *this); @@ -1993,16 +1989,11 @@ QPixmap QPixmap::fromImage(const QImage &image, Qt::ImageConversionFlags flags) if (image.isNull()) return QPixmap(); - QT_TRY { - QGraphicsSystem* gs = QApplicationPrivate::graphicsSystem(); - QScopedPointer<QPixmapData> data(gs ? gs->createPixmapData(QPixmapData::PixmapType) - : QGraphicsSystem::createDefaultPixmapData(QPixmapData::PixmapType)); - data->fromImage(image, flags); - return QPixmap(data.take()); - } QT_CATCH(const std::bad_alloc &) { - // we're out of memory - return a null Pixmap - return QPixmap(); - } + QGraphicsSystem* gs = QApplicationPrivate::graphicsSystem(); + QScopedPointer<QPixmapData> data(gs ? gs->createPixmapData(QPixmapData::PixmapType) + : QGraphicsSystem::createDefaultPixmapData(QPixmapData::PixmapType)); + data->fromImage(image, flags); + return QPixmap(data.take()); } /*! |