r15191 by jghali - barcode plugin : fix memory leak + undo transaction being potentially never canceled or committed
scribus-commit
scribus-commit at lists.scribus.net
Tue Jun 15 22:50:42 CEST 2010
Revision: 15191
Author: jghali
Date: 2010-06-15T20:48:18.107121Z
Commit message: barcode plugin : fix memory leak + undo transaction being potentially never canceled or committed
Changeset:
M /trunk/Scribus/scribus/plugins/barcodegenerator/barcodegenerator.cpp
Diffs:
Index: scribus/plugins/barcodegenerator/barcodegenerator.cpp
===================================================================
--- scribus/plugins/barcodegenerator/barcodegenerator.cpp (revision 15190)
+++ scribus/plugins/barcodegenerator/barcodegenerator.cpp (revision 15191)
@@ -17,9 +17,9 @@
#include "util_icon.h"
#include "ui/colorm.h"
+#include <QSharedPointer>
#include <QTextStream>
-
BarcodeType::BarcodeType(QString cmd, QString exa,
QString comm, QString regExp,
bool includeCheck, bool includeCheckInText)
@@ -260,17 +260,18 @@
hide();
const FileFormat * fmt = LoadSavePlugin::getFormatById(FORMATID_PSIMPORT);
- UndoTransaction * tran = 0;
+ QSharedPointer<UndoTransaction> tran;
if (UndoManager::undoEnabled())
{
- tran = new UndoTransaction(
+ tran = QSharedPointer<UndoTransaction>( new UndoTransaction(
UndoManager::instance()->beginTransaction(
ScCore->primaryMainWindow()->doc->currentPage()->getUName(),
Um::IImageFrame,
Um::ImportBarcode,
ui.bcCombo->currentText() + " (" + ui.codeEdit->text() + ")",
Um::IEPS)
- );
+ )
+ );
}
if (fmt)
More information about the scribus-commit
mailing list