Bug 1346143 - Forget the widget pointer in WebRenderLayerManager::Destroy() r=nical
authorsotaro <sotaro.ikeda.g@gmail.com>
Fri, 21 Apr 2017 18:31:52 +0900
changeset 403284 68b48ae09aedd2a291867c270b23f6aeac75fcdc
parent 403283 1a304bffd9a34aa6f94a9944127d50a6ac3f21ac
child 403285 2075cd677dc9a81e7a02afdf356a60419fcde273
push id7391
push usermtabara@mozilla.com
push dateMon, 12 Jun 2017 13:08:53 +0000
treeherdermozilla-beta@2191d7f87e2e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnical
bugs1346143
milestone55.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 1346143 - Forget the widget pointer in WebRenderLayerManager::Destroy() r=nical
gfx/layers/wr/WebRenderLayerManager.cpp
--- a/gfx/layers/wr/WebRenderLayerManager.cpp
+++ b/gfx/layers/wr/WebRenderLayerManager.cpp
@@ -286,21 +286,26 @@ WebRenderLayerManager::Destroy()
 
   if (mTransactionIdAllocator) {
     // Make sure to notify the refresh driver just in case it's waiting on a
     // pending transaction. Do this at the top of the event loop so we don't
     // cause a paint to occur during compositor shutdown.
     RefPtr<TransactionIdAllocator> allocator = mTransactionIdAllocator;
     uint64_t id = mLatestTransactionId;
 
-    RefPtr<Runnable> task = NS_NewRunnableFunction([allocator, id] () -> void {
+    RefPtr<Runnable> task = NS_NewRunnableFunction(
+      "TransactionIdAllocator::NotifyTransactionCompleted",
+      [allocator, id] () -> void {
       allocator->NotifyTransactionCompleted(id);
     });
     NS_DispatchToMainThread(task.forget());
   }
+
+  // Forget the widget pointer in case we outlive our owning widget.
+  mWidget = nullptr;
 }
 
 WebRenderLayerManager::~WebRenderLayerManager()
 {
   Destroy();
   MOZ_COUNT_DTOR(WebRenderLayerManager);
 }