Commit a673aedb authored by Craig Watson's avatar Craig Watson

OS X 10.10: Fixed crashing on .ubz export

parent 8e1b5c4e
...@@ -152,12 +152,12 @@ void UBPlatformUtils::setFileType(const QString &filePath, unsigned long fileTyp ...@@ -152,12 +152,12 @@ void UBPlatformUtils::setFileType(const QString &filePath, unsigned long fileTyp
CFStringRef path = CFStringCreateWithCharacters(0, reinterpret_cast<const UniChar *>(filePath.unicode()), filePath.length()); CFStringRef path = CFStringCreateWithCharacters(0, reinterpret_cast<const UniChar *>(filePath.unicode()), filePath.length());
const CFIndex maxSize = CFStringGetMaximumSizeOfFileSystemRepresentation(path); const CFIndex maxSize = CFStringGetMaximumSizeOfFileSystemRepresentation(path);
UInt8 fileSystemRepresentation[maxSize]; UInt8 fileSystemRepresentation[maxSize];
CFRelease(path);
if (!CFStringGetFileSystemRepresentation(path, (char*)fileSystemRepresentation, maxSize)) if (!CFStringGetFileSystemRepresentation(path, (char*)fileSystemRepresentation, maxSize))
{ {
return; return;
} }
CFRelease(path);
OSStatus status = FSPathMakeRefWithOptions(fileSystemRepresentation, kFSPathMakeRefDefaultOptions, &ref, NULL); OSStatus status = FSPathMakeRefWithOptions(fileSystemRepresentation, kFSPathMakeRefDefaultOptions, &ref, NULL);
if (status != noErr) if (status != noErr)
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment