summaryrefslogtreecommitdiffstats
path: root/examples/touch
diff options
context:
space:
mode:
authorMontel Laurent <kdeqt@yahoo.fr>2012-11-30 12:50:53 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2012-11-30 23:56:02 +0100
commitc565ef6d72ea4b95cfc72edbb67af27f8ef35fb5 (patch)
tree3c4395624a8a789226d55f58c31b274412bd41ef /examples/touch
parent930207fc1f66566d563b820af5d2efc7bec3b610 (diff)
Fix memory leak. PrinterDialog is not deleted when close it
Change-Id: I9f0a300cdaf9803bc2ad723946ac4d0f825cc28b Reviewed-by: David Faure <david.faure@kdab.com>
Diffstat (limited to 'examples/touch')
-rw-r--r--examples/touch/fingerpaint/scribblearea.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/examples/touch/fingerpaint/scribblearea.cpp b/examples/touch/fingerpaint/scribblearea.cpp
index b0dd719ccd..7e0c8edab1 100644
--- a/examples/touch/fingerpaint/scribblearea.cpp
+++ b/examples/touch/fingerpaint/scribblearea.cpp
@@ -157,9 +157,9 @@ void ScribbleArea::print()
#ifndef QT_NO_PRINTER
QPrinter printer(QPrinter::HighResolution);
- QPrintDialog *printDialog = new QPrintDialog(&printer, this);
+ QPrintDialog printDialog(&printer, this);
//! [21] //! [22]
- if (printDialog->exec() == QDialog::Accepted) {
+ if (printDialog.exec() == QDialog::Accepted) {
QPainter painter(&printer);
QRect rect = painter.viewport();
QSize size = image.size();