Bug 1402818 - Set hwnd_ to NULL in PlatformUIThread::Stop(); r=pehrsons
authorDan Minor <dminor@mozilla.com>
Thu, 28 Sep 2017 16:32:31 -0400
changeset 426341 8351809213871b096cbaa82915c8568dccb56cbf
parent 426340 64949972673f2d167b7e62a2dbc6ec37cb6751b1
child 426342 d6d28844bbef5f959277cbe8b1044d7dbfcad692
push id97
push userfmarier@mozilla.com
push dateSat, 14 Oct 2017 01:12:59 +0000
reviewerspehrsons
bugs1402818
milestone58.0a1
Bug 1402818 - Set hwnd_ to NULL in PlatformUIThread::Stop(); r=pehrsons We only create an event window in Start() if hwnd_ is NULL, but Stop() does not set it to NULL. This causes the thread to no longer be a GUI thread if Stop() and then Start() is called on the same thread leading to assertion failures. MozReview-Commit-ID: 5TpazUCqBuR
media/webrtc/trunk/webrtc/base/platform_thread.cc
--- a/media/webrtc/trunk/webrtc/base/platform_thread.cc
+++ b/media/webrtc/trunk/webrtc/base/platform_thread.cc
@@ -269,16 +269,18 @@ void PlatformUIThread::Stop() {
   // Shut down the dispatch loop and let the background thread exit.
   if (timerid_) {
     KillTimer(hwnd_, timerid_);
     timerid_ = 0;
   }
 
   PostMessage(hwnd_, WM_CLOSE, 0, 0);
 
+  hwnd_ = NULL;
+
   PlatformThread::Stop();
 }
 #endif
 
 void PlatformThread::Run() {
   if (!name_.empty())
     rtc::SetCurrentThreadName(name_.c_str());
   do {