From 0102ee1de421a26a8bfd853146e485c3686baef6 Mon Sep 17 00:00:00 2001 From: Stefano Pironato Date: Mon, 29 Mar 2010 15:56:27 +0300 Subject: Fix valgrind report shows memory leak for QImage::save(). Reviewed-by: Marius Storm-Olsen --- src/gui/image/qimagewriter.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/gui/image/qimagewriter.cpp b/src/gui/image/qimagewriter.cpp index a5f7b31..503a1b2 100644 --- a/src/gui/image/qimagewriter.cpp +++ b/src/gui/image/qimagewriter.cpp @@ -197,6 +197,7 @@ static QImageIOHandler *createWriteHandlerHelper(QIODevice *device, for (int i = 0; i < keys.size(); ++i) { QImageIOPlugin *plugin = qobject_cast(l->instance(keys.at(i))); if (plugin && (plugin->capabilities(device, testFormat) & QImageIOPlugin::CanWrite)) { + delete handler; handler = plugin->create(device, testFormat); break; } -- cgit v0.12