- wxAppTraits *traits = wxTheApp ? wxTheApp->GetTraits() : NULL;
- wxCHECK_MSG( traits, -1, _T("no wxAppTraits in wxExecute()?") );
+ wxAppTraits *traits = NULL;
+ void *cookie = NULL;
+ if ( !(flags & wxEXEC_NODISABLE) )
+ {
+ if ( wxTheApp )
+ traits = wxTheApp->GetTraits();
+ wxCHECK_MSG( traits, -1, _T("no wxAppTraits in wxExecute()?") );