]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/thread.cpp
compilation fix (not all paths returned a value)
[wxWidgets.git] / src / msw / thread.cpp
index 92f34c9ca8b8914972b31ffd03b9be0b7aacc6f8..df5f2f2ba7b2f6d478c955e8be458afe63f169cf 100644 (file)
@@ -629,6 +629,9 @@ void wxThreadInternal::SetPriority(unsigned int priority)
 
 bool wxThreadInternal::Create(wxThread *thread, unsigned int stackSize)
 {
+    wxASSERT_MSG( m_state == STATE_NEW && !m_hThread,
+                    _T("Create()ing thread twice?") );
+
     // for compilers which have it, we should use C RTL function for thread
     // creation instead of Win32 API one because otherwise we will have memory
     // leaks if the thread uses C RTL (and most threads do)
@@ -674,8 +677,6 @@ bool wxThreadInternal::Create(wxThread *thread, unsigned int stackSize)
         SetPriority(m_priority);
     }
 
-    m_state = STATE_NEW;
-
     return TRUE;
 }