summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms
diff options
context:
space:
mode:
authorAndy Shaw <andy.shaw@digia.com>2013-08-08 11:05:26 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-08-08 12:43:35 +0200
commit3e078cf36db538c95fd9b491a69196e882c24e0a (patch)
tree3256004b915bc5d15c30513cbbd377141be63925 /src/plugins/platforms
parentfeacbdb746681d8c51c78a6082d456c498b843b4 (diff)
Don't release the printer after using it to change a property
The printer should not be released after changing a property on it as it is still needed by QPrinter elsewhere. It is released as appropriate automatically already. Task-number: QTBUG-32831 Change-Id: Idb2d98b25b62f343015a0a0fb3c9a0d506546132 Reviewed-by: Liang Qi <liang.qi@digia.com> Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
Diffstat (limited to 'src/plugins/platforms')
-rw-r--r--src/plugins/platforms/cocoa/qprintengine_mac.mm5
1 files changed, 1 insertions, 4 deletions
diff --git a/src/plugins/platforms/cocoa/qprintengine_mac.mm b/src/plugins/platforms/cocoa/qprintengine_mac.mm
index 2dedf99582..ee8d7ea157 100644
--- a/src/plugins/platforms/cocoa/qprintengine_mac.mm
+++ b/src/plugins/platforms/cocoa/qprintengine_mac.mm
@@ -187,10 +187,8 @@ void QMacPrintEnginePrivate::setPaperName(const QString &name)
if (PMSessionGetCurrentPrinter(session(), &printer) == noErr) {
CFArrayRef array;
- if (PMPrinterGetPaperList(printer, &array) != noErr) {
- PMRelease(printer);
+ if (PMPrinterGetPaperList(printer, &array) != noErr)
return;
- }
int count = CFArrayGetCount(array);
for (int i = 0; i < count; ++i) {
PMPaper paper = static_cast<PMPaper>(const_cast<void *>(CFArrayGetValueAtIndex(array, i)));
@@ -208,7 +206,6 @@ void QMacPrintEnginePrivate::setPaperName(const QString &name)
}
}
}
- PMRelease(printer);
}
}