diff --git a/src/frameworks/UBPlatformUtils_mac.mm b/src/frameworks/UBPlatformUtils_mac.mm index a0440537..1bbb6a22 100644 --- a/src/frameworks/UBPlatformUtils_mac.mm +++ b/src/frameworks/UBPlatformUtils_mac.mm @@ -152,12 +152,12 @@ void UBPlatformUtils::setFileType(const QString &filePath, unsigned long fileTyp CFStringRef path = CFStringCreateWithCharacters(0, reinterpret_cast(filePath.unicode()), filePath.length()); const CFIndex maxSize = CFStringGetMaximumSizeOfFileSystemRepresentation(path); UInt8 fileSystemRepresentation[maxSize]; - CFRelease(path); if (!CFStringGetFileSystemRepresentation(path, (char*)fileSystemRepresentation, maxSize)) { return; } + CFRelease(path); OSStatus status = FSPathMakeRefWithOptions(fileSystemRepresentation, kFSPathMakeRefDefaultOptions, &ref, NULL); if (status != noErr) {