Bug 1153469: Ensure IOSurface isn't released before being composited. r=mattwoodrow, a=sledru
authorJean-Yves Avenard <jyavenard@mozilla.com>
Sun, 12 Apr 2015 18:22:07 +1000
changeset 258428 7efd806788be
parent 258427 10f75583d21a
child 258429 10c3198eb453
push id4667
push userjyavenard@mozilla.com
push date2015-04-13 13:11 +0000
treeherdermozilla-beta@7efd806788be [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmattwoodrow, sledru
bugs1153469
milestone38.0
Bug 1153469: Ensure IOSurface isn't released before being composited. r=mattwoodrow, a=sledru
gfx/layers/opengl/MacIOSurfaceTextureClientOGL.cpp
--- a/gfx/layers/opengl/MacIOSurfaceTextureClientOGL.cpp
+++ b/gfx/layers/opengl/MacIOSurfaceTextureClientOGL.cpp
@@ -11,17 +11,21 @@ namespace layers {
 
 MacIOSurfaceTextureClientOGL::MacIOSurfaceTextureClientOGL(ISurfaceAllocator* aAllcator,
                                                            TextureFlags aFlags)
   : TextureClient(aAllcator, aFlags)
   , mIsLocked(false)
 {}
 
 MacIOSurfaceTextureClientOGL::~MacIOSurfaceTextureClientOGL()
-{}
+{
+  if (mActor && mSurface) {
+    KeepUntilFullDeallocation(MakeUnique<TKeepAlive<MacIOSurface>>(mSurface));
+  }
+}
 
 void
 MacIOSurfaceTextureClientOGL::InitWith(MacIOSurface* aSurface)
 {
   MOZ_ASSERT(IsValid());
   MOZ_ASSERT(!IsAllocated());
   mSurface = aSurface;
 }