Bug 1639634: Add null check for mTranslationTaskQueue to CanvasTranslator::ActorDestroy. r=mattwoodrow
authorBob Owen <bobowencode@gmail.com>
Thu, 21 May 2020 00:05:34 +0000
changeset 531391 e1a8383cf9f9d914a35efd6298e3c7990e1e37f7
parent 531390 06c02224ce5df7b44b706371696703968b206167
child 531392 29b8614020142dfcf89a3df60f3cbad23d992f84
push id37439
push userbtara@mozilla.com
push dateThu, 21 May 2020 21:49:34 +0000
treeherdermozilla-central@92c11f0bf14b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmattwoodrow
bugs1639634
milestone78.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1639634: Add null check for mTranslationTaskQueue to CanvasTranslator::ActorDestroy. r=mattwoodrow Differential Revision: https://phabricator.services.mozilla.com/D76183
gfx/layers/ipc/CanvasTranslator.cpp
--- a/gfx/layers/ipc/CanvasTranslator.cpp
+++ b/gfx/layers/ipc/CanvasTranslator.cpp
@@ -154,16 +154,20 @@ void CanvasTranslator::StartTranslation(
   if (!TranslateRecording() && GetIPCChannel()->CanSend()) {
     MOZ_ALWAYS_SUCCEEDS(mTranslationTaskQueue->Dispatch(
         NewRunnableMethod("CanvasTranslator::StartTranslation", this,
                           &CanvasTranslator::StartTranslation)));
   }
 }
 
 void CanvasTranslator::ActorDestroy(ActorDestroyReason why) {
+  if (!mTranslationTaskQueue) {
+    return FinishShutdown();
+  }
+
   mTranslationTaskQueue->BeginShutdown()->Then(
       MessageLoop::current()->SerialEventTarget(), __func__, this,
       &CanvasTranslator::FinishShutdown, &CanvasTranslator::FinishShutdown);
 }
 
 void CanvasTranslator::FinishShutdown() {
   // mTranslationTaskQueue has shutdown we can safely drop the ring buffer to
   // break the cycle caused by RingBufferReaderServices.