summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/cocoa/qcocoaprintdevice.mm
diff options
context:
space:
mode:
authorDyami Caliri <dyami@dragonframe.com>2014-10-29 14:10:05 -0700
committerDyami Caliri <dyami@dragonframe.com>2014-10-30 21:23:10 +0100
commitdd6876f3fdeb4b95a24fba4ad48cbf445b8fb9f4 (patch)
tree3de052e7116c80c59d02d94316fff092d20e305e /src/plugins/platforms/cocoa/qcocoaprintdevice.mm
parentaf5f6e35b6f17e06a85aee445d97e61b6b4bba3e (diff)
QCocoaPrintDevice: fix bad CFRelease
CFRelease should be called IFF PMPrinterCopyDescriptionURL succeeds Change-Id: Id289aea3a4e3da397dae4062319256a043538597 Reviewed-by: Jake Petroules <jake.petroules@petroules.com>
Diffstat (limited to 'src/plugins/platforms/cocoa/qcocoaprintdevice.mm')
-rw-r--r--src/plugins/platforms/cocoa/qcocoaprintdevice.mm8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/plugins/platforms/cocoa/qcocoaprintdevice.mm b/src/plugins/platforms/cocoa/qcocoaprintdevice.mm
index b3551e2c29..c26a2b22fd 100644
--- a/src/plugins/platforms/cocoa/qcocoaprintdevice.mm
+++ b/src/plugins/platforms/cocoa/qcocoaprintdevice.mm
@@ -468,11 +468,11 @@ bool QCocoaPrintDevice::openPpdFile()
CFURLRef ppdURL = NULL;
char ppdPath[MAXPATHLEN];
if (PMPrinterCopyDescriptionURL(m_printer, kPMPPDDescriptionType, &ppdURL) == noErr
- && ppdURL != NULL
- && CFURLGetFileSystemRepresentation(ppdURL, true, (UInt8*)ppdPath, sizeof(ppdPath))) {
- m_ppd = ppdOpenFile(ppdPath);
+ && ppdURL != NULL) {
+ if (CFURLGetFileSystemRepresentation(ppdURL, true, (UInt8*)ppdPath, sizeof(ppdPath)))
+ m_ppd = ppdOpenFile(ppdPath);
+ CFRelease(ppdURL);
}
- CFRelease(ppdURL);
return m_ppd ? true : false;
}