From 3e078cf36db538c95fd9b491a69196e882c24e0a Mon Sep 17 00:00:00 2001 From: Andy Shaw Date: Thu, 8 Aug 2013 11:05:26 +0200 Subject: 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 Reviewed-by: Gabriel de Dietrich --- src/plugins/platforms/cocoa/qprintengine_mac.mm | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'src/plugins/platforms/cocoa') 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(const_cast(CFArrayGetValueAtIndex(array, i))); @@ -208,7 +206,6 @@ void QMacPrintEnginePrivate::setPaperName(const QString &name) } } } - PMRelease(printer); } } -- cgit v1.2.3