Bug 1114976 - Don't try to free TextureClients if allocation failed. r=nical, a=sledru
authorMatt Woodrow <mwoodrow@mozilla.com>
Thu, 05 Feb 2015 14:11:46 +1300
changeset 243698 74c4e5bdde78
parent 243697 9b1ff4e3ca58
child 243699 14d3deb83b7f
push id4440
push userryanvm@gmail.com
push date2015-02-05 16:07 +0000
treeherdermozilla-beta@74c4e5bdde78 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnical, sledru
bugs1114976
milestone36.0
Bug 1114976 - Don't try to free TextureClients if allocation failed. r=nical, a=sledru
gfx/layers/ipc/ImageBridgeChild.cpp
--- a/gfx/layers/ipc/ImageBridgeChild.cpp
+++ b/gfx/layers/ipc/ImageBridgeChild.cpp
@@ -384,16 +384,20 @@ static void ReleaseTextureClientNow(Text
 {
   MOZ_ASSERT(InImageBridgeChildThread());
   aClient->Release();
 }
 
 // static
 void ImageBridgeChild::DispatchReleaseTextureClient(TextureClient* aClient)
 {
+  if (!aClient) {
+    return;
+  }
+
   if (!IsCreated()) {
     // TextureClient::Release should normally happen in the ImageBridgeChild
     // thread because it usually generate some IPDL messages.
     // However, if we take this branch it means that the ImageBridgeChild
     // has already shut down, along with the TextureChild, which means no
     // message will be sent and it is safe to run this code from any thread.
     MOZ_ASSERT(aClient->GetIPDLActor() == nullptr);
     aClient->Release();