Bug 951218 - Fix a bug in AutoLockTextureHost. r=bjacob
authorNicolas Silva <nical@mozilla.com>
Fri, 20 Dec 2013 23:30:52 +0100
changeset 171862 90b70511ded6a6d06733882fa04a328792fc6f0b
parent 171861 5a1833435382e3b9085d7264c45110c1097a2e03
child 171863 3aab84544332b001772342922da9a5b033ae0cff
push id5166
push userlsblakk@mozilla.com
push dateTue, 04 Feb 2014 01:47:54 +0000
treeherdermozilla-aurora@977eb2548b2d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbjacob
bugs951218
milestone29.0a1
Bug 951218 - Fix a bug in AutoLockTextureHost. r=bjacob
gfx/layers/composite/TextureHost.h
--- a/gfx/layers/composite/TextureHost.h
+++ b/gfx/layers/composite/TextureHost.h
@@ -781,28 +781,27 @@ protected:
 };
 
 class MOZ_STACK_CLASS AutoLockTextureHost
 {
 public:
   AutoLockTextureHost(TextureHost* aTexture)
     : mTexture(aTexture)
   {
-    MOZ_ASSERT(mTexture);
-    mLocked = aTexture->Lock();
+    mLocked = mTexture ? mTexture->Lock() : false;
   }
 
   ~AutoLockTextureHost()
   {
-    if (mLocked) {
+    if (mTexture && mLocked) {
       mTexture->Unlock();
     }
   }
 
-  bool Failed() { return !mLocked; }
+  bool Failed() { return mTexture && !mLocked; }
 
 private:
   RefPtr<TextureHost> mTexture;
   bool mLocked;
 };
 
 class AutoLockDeprecatedTextureHost
 {