]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/utilsexc.cpp
Move POSIX implementation of wxThread::Create() to wxThreadInternal.
[wxWidgets.git] / src / msw / utilsexc.cpp
index 7198e1106f30ef4cec6e4b4b6adb896cf5c8896d..9c959de05ed4231c672ab89a6c4f8ea036943bc9 100644 (file)
@@ -862,23 +862,26 @@ long wxExecute(const wxString& cmd, int flags, wxProcess *handler,
     }
 
     // Translate wxWidgets priority to Windows conventions.
-    unsigned prio = handler->GetPriority();
-    if ( prio <= 20 )
-        dwFlags |= IDLE_PRIORITY_CLASS;
-    else if ( prio <= 40 )
-        dwFlags |= BELOW_NORMAL_PRIORITY_CLASS;
-    else if ( prio <= 60 )
-        dwFlags |= NORMAL_PRIORITY_CLASS;
-    else if ( prio <= 80 )
-        dwFlags |= ABOVE_NORMAL_PRIORITY_CLASS;
-    else if ( prio <= 99 )
-        dwFlags |= HIGH_PRIORITY_CLASS;
-    else if ( prio <= 100 )
-        dwFlags |= REALTIME_PRIORITY_CLASS;
-    else
+    if ( handler )
     {
-        wxFAIL_MSG(wxT("invalid value of thread priority parameter"));
-        dwFlags |= THREAD_PRIORITY_NORMAL;
+        unsigned prio = handler->GetPriority();
+        if ( prio <= 20 )
+            dwFlags |= IDLE_PRIORITY_CLASS;
+        else if ( prio <= 40 )
+            dwFlags |= BELOW_NORMAL_PRIORITY_CLASS;
+        else if ( prio <= 60 )
+            dwFlags |= NORMAL_PRIORITY_CLASS;
+        else if ( prio <= 80 )
+            dwFlags |= ABOVE_NORMAL_PRIORITY_CLASS;
+        else if ( prio <= 99 )
+            dwFlags |= HIGH_PRIORITY_CLASS;
+        else if ( prio <= 100 )
+            dwFlags |= REALTIME_PRIORITY_CLASS;
+        else
+        {
+            wxFAIL_MSG(wxT("invalid value of thread priority parameter"));
+            dwFlags |= NORMAL_PRIORITY_CLASS;
+        }
     }
 
     bool ok = ::CreateProcess