Merge topic 'fix-macos-findprogramm-crash'

0d2f5c8 Fix crash if app bundle executeable couldn't be found
This commit is contained in:
David Cole 2012-03-02 11:45:48 -05:00 committed by CMake Topic Stage
commit aba1c1aa3b
1 changed files with 2 additions and 1 deletions

View File

@ -175,6 +175,8 @@ std::string cmFindProgramCommand::GetBundleExecutable(std::string bundlePath)
// And finally to a c++ string
executable = bundlePath + "/Contents/MacOS/" + std::string(buffer);
// Only release CFURLRef if it's not null
CFRelease( executableURL );
}
// Any CF objects returned from functions with "create" or
@ -182,7 +184,6 @@ std::string cmFindProgramCommand::GetBundleExecutable(std::string bundlePath)
CFRelease( bundlePathCFS );
CFRelease( bundleURL );
CFRelease( appBundle );
CFRelease( executableURL );
#endif
return executable;