r15189 by jghali - #9171 : fix potential crash on exit after using image export plugin

scribus-commit scribus-commit at lists.scribus.net
Tue Jun 15 21:00:41 CEST 2010


Revision: 15189
Author: jghali
Date: 2010-06-15T18:52:47.259722Z
Commit message: #9171 : fix potential crash on exit after using image export plugin

Changeset: 
M  /trunk/Scribus/scribus/plugins/pixmapexport/export.cpp

Diffs:
Index: scribus/plugins/pixmapexport/export.cpp
===================================================================
--- scribus/plugins/pixmapexport/export.cpp	(revision 15188)
+++ scribus/plugins/pixmapexport/export.cpp	(revision 15189)
@@ -10,6 +10,7 @@
 #include <QString>
 #include <QDir>
 #include <QCursor>
+#include <QSharedPointer>
 
 #include "ui/scmessagebox.h"
 #include "scribus.h"
@@ -94,8 +95,8 @@
 {
 	Q_ASSERT(target.isEmpty());
 	Q_ASSERT(!doc->masterPageMode());
-	ExportBitmap *ex = new ExportBitmap();
-	ExportForm *dia = new ExportForm(doc->scMW(), doc, ex->pageDPI, ex->quality, ex->bitmapType);
+	QSharedPointer<ExportBitmap> ex( new ExportBitmap() );
+	QSharedPointer<ExportForm>  dia( new ExportForm(doc->scMW(), doc, ex->pageDPI, ex->quality, ex->bitmapType) );
 
 	// interval widgets handling
 	QString tmp;
@@ -144,9 +145,6 @@
 		if (res)
 			doc->scMW()->setStatusBarInfoText( tr("Export successful"));
 	}
-	// clean the trash
-	delete ex;
-	delete dia;
 	return true;
 }
 




More information about the scribus-commit mailing list