Fix leaks in OS X bundle detection

There were several leaked CFStringRefs in the new OS X bundle detection
code that is part of QFileSystemEngine.

Change-Id: Id0817e9692da411c7eb8287b9bf71b99ae28f960
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Samuel Gaist <samuel.gaist@edeltech.ch>
Reviewed-by: Jake Petroules <jake.petroules@petroules.com>
This commit is contained in:
Dyami Caliri 2014-10-10 09:56:13 -07:00
parent 46d3c25980
commit 2b99491692

View File

@ -83,13 +83,13 @@ static bool isPackage(const QFileSystemMetaData &data, const QFileSystemEntry &e
if (suffix.length() > 0) {
// First step: is the extension known ?
CFStringRef extensionRef = QCFString::toCFStringRef(suffix);
CFStringRef uniformTypeIdentifier = UTTypeCreatePreferredIdentifierForTag(kUTTagClassFilenameExtension, extensionRef, NULL);
QCFType<CFStringRef> extensionRef = QCFString::toCFStringRef(suffix);
QCFType<CFStringRef> uniformTypeIdentifier = UTTypeCreatePreferredIdentifierForTag(kUTTagClassFilenameExtension, extensionRef, NULL);
if (UTTypeConformsTo(uniformTypeIdentifier, kUTTypeBundle))
return true;
// Second step: check if an application knows the package type
CFStringRef path = QCFString::toCFStringRef(entry.filePath());
QCFType<CFStringRef> path = QCFString::toCFStringRef(entry.filePath());
QCFType<CFURLRef> url = CFURLCreateWithFileSystemPath(0, path, kCFURLPOSIXPathStyle, true);
UInt32 type, creator;