X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/8f0ff178513f59471bfce85cf6d7a78f4f4818ab..7beafee9423f4cfa2fb08c8c5ff579f884314c79:/src/msw/utilsexc.cpp diff --git a/src/msw/utilsexc.cpp b/src/msw/utilsexc.cpp index 8899b5e0f1..5ba14aad62 100644 --- a/src/msw/utilsexc.cpp +++ b/src/msw/utilsexc.cpp @@ -888,11 +888,17 @@ long wxExecute(const wxString& cmd, int flags, wxProcess *handler) return pi.dwProcessId; } - wxAppTraits *traits = wxTheApp ? wxTheApp->GetTraits() : NULL; - wxCHECK_MSG( traits, -1, _T("no wxAppTraits in wxExecute()?") ); + wxAppTraits *traits = NULL; + void *cookie wxDUMMY_INITIALIZE(NULL); + if ( !(flags & wxEXEC_NODISABLE) ) + { + if ( wxTheApp ) + traits = wxTheApp->GetTraits(); + wxCHECK_MSG( traits, -1, _T("no wxAppTraits in wxExecute()?") ); - // disable all app windows while waiting for the child process to finish - void *cookie = traits->BeforeChildWaitLoop(); + // disable all app windows while waiting for the child process to finish + cookie = traits->BeforeChildWaitLoop(); + } // wait until the child process terminates while ( data->state ) @@ -910,7 +916,8 @@ long wxExecute(const wxString& cmd, int flags, wxProcess *handler) traits->AlwaysYield(); } - traits->AfterChildWaitLoop(cookie); + if ( traits ) + traits->AfterChildWaitLoop(cookie); DWORD dwExitCode = data->dwExitCode; delete data;