diff -r cc75c76972ee -r c0432d11811c src/gui/image/qimagewriter.cpp --- a/src/gui/image/qimagewriter.cpp Wed Apr 21 12:15:23 2010 +0300 +++ b/src/gui/image/qimagewriter.cpp Wed Apr 21 20:15:53 2010 +0300 @@ -197,6 +197,7 @@ 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; }