QCocoaPrintDevice: fix bad CFRelease
CFRelease should be called IFF PMPrinterCopyDescriptionURL succeeds Change-Id: Id289aea3a4e3da397dae4062319256a043538597 Reviewed-by: Jake Petroules <jake.petroules@petroules.com>
This commit is contained in:
parent
af5f6e35b6
commit
dd6876f3fd
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user