Merge topic 'fix-macos-findprogramm-crash'
0d2f5c8
Fix crash if app bundle executeable couldn't be found
This commit is contained in:
commit
aba1c1aa3b
|
@ -175,6 +175,8 @@ std::string cmFindProgramCommand::GetBundleExecutable(std::string bundlePath)
|
||||||
|
|
||||||
// And finally to a c++ string
|
// And finally to a c++ string
|
||||||
executable = bundlePath + "/Contents/MacOS/" + std::string(buffer);
|
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
|
// Any CF objects returned from functions with "create" or
|
||||||
|
@ -182,7 +184,6 @@ std::string cmFindProgramCommand::GetBundleExecutable(std::string bundlePath)
|
||||||
CFRelease( bundlePathCFS );
|
CFRelease( bundlePathCFS );
|
||||||
CFRelease( bundleURL );
|
CFRelease( bundleURL );
|
||||||
CFRelease( appBundle );
|
CFRelease( appBundle );
|
||||||
CFRelease( executableURL );
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return executable;
|
return executable;
|
||||||
|
|
Loading…
Reference in New Issue