git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@34005
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
int flags,
wxProcess *process)
{
int flags,
wxProcess *process)
{
+ const long errorCode = ((flags & wxEXEC_SYNC) ? -1 : 0);
+ const long successCode = ((flags & wxEXEC_SYNC) ? 0 : -1); // fake PID
+
CFIndex cfiCount = 0;
//get count
for(wxChar** argvcopy = argv; *argvcopy != NULL ; ++argvcopy)
CFIndex cfiCount = 0;
//get count
for(wxChar** argvcopy = argv; *argvcopy != NULL ; ++argvcopy)
if(cfiCount == 0) //no file to launch?
{
wxLogDebug(wxT("wxMacExecute No file to launch!"));
if(cfiCount == 0) //no file to launch?
{
wxLogDebug(wxT("wxMacExecute No file to launch!"));
}
CFURLRef cfurlApp = CFURLCreateWithString(
}
CFURLRef cfurlApp = CFURLCreateWithString(
{
wxLogDebug(wxT("wxMacExecute Bad bundle"));
CFRelease(cfurlApp);
{
wxLogDebug(wxT("wxMacExecute Bad bundle"));
CFRelease(cfurlApp);
if(dwBundleType != 'APPL')
{
CFRelease(cfurlApp);
if(dwBundleType != 'APPL')
{
CFRelease(cfurlApp);
}
//
// We have a good bundle - so let's launch it!
//
}
//
// We have a good bundle - so let's launch it!
//
- CFMutableArrayRef cfaFiles = CFArrayCreateMutable(kCFAllocatorDefault, cfiCount - 1, NULL);
+ CFMutableArrayRef cfaFiles =
+ CFArrayCreateMutable(kCFAllocatorDefault, cfiCount - 1, &kCFTypeArrayCallBacks);
cfaFiles,
cfurlCurrentFile
);
cfaFiles,
cfurlCurrentFile
);
+ CFRelease(cfurlCurrentFile); // array has retained it
if(status != noErr)
{
wxLogDebug(wxString::Format(wxT("wxMacExecute ERROR: %d")), (int)status);
if(status != noErr)
{
wxLogDebug(wxString::Format(wxT("wxMacExecute ERROR: %d")), (int)status);
+ return successCode; //success
long lRc;
#if defined(__DARWIN__)
// wxMacExecute only executes app bundles.
long lRc;
#if defined(__DARWIN__)
// wxMacExecute only executes app bundles.
- // It returns -1 if the target is not an app bundle, thus falling through
- // to the regular wxExecute for non app bundles.
+ // It returns an error code if the target is not an app bundle, thus falling
+ // through to the regular wxExecute for non app bundles.
lRc = wxMacExecute(argv, flags, process);
lRc = wxMacExecute(argv, flags, process);
+ if( lRc != ((flags & wxEXEC_SYNC) ? -1 : 0))