diff --git a/dom/media/systemservices/video_engine/platform_uithread.cc b/dom/media/systemservices/video_engine/platform_uithread.cc index 2cc2f61005e0..77cdd44e4557 100644 --- a/dom/media/systemservices/video_engine/platform_uithread.cc +++ b/dom/media/systemservices/video_engine/platform_uithread.cc @@ -75,9 +75,10 @@ void PlatformUIThread::Stop() { PostMessage(hwnd_, WM_CLOSE, 0, 0); - hwnd_ = NULL; - PlatformThread::Stop(); + + // do this after stop to make sure in-progress operations are finished. + hwnd_ = NULL; } void PlatformUIThread::Run() {