Explicitly remove CALayer from CARenderer when CARenderer is destroyed in order to avoid situations where the CALayer is attached to two renderers. b=556453 r=josh
authorBenoit Girard <bgirard@mozilla.com>
Mon, 05 Apr 2010 00:29:56 -0400
changeset 40213 c4df407008b5ad4c359fc834ae9efb639cfeeb5d
parent 40212 d242d4ecdbff20f21fecb2a222a4a41bd39899b9
child 40214 54bac63895042cd8412f9dcff25ff54c49b8f6bd
push id12603
push userjosh@mozilla.com
push dateMon, 05 Apr 2010 04:30:27 +0000
treeherdermozilla-central@c4df407008b5 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjosh
bugs556453
milestone1.9.3a4pre
first release with
nightly linux32
c4df407008b5 / 3.7a4pre / 20100405030428 / files
nightly linux64
c4df407008b5 / 3.7a4pre / 20100405030628 / files
nightly mac
c4df407008b5 / 3.7a4pre / 20100405030622 / files
nightly win32
c4df407008b5 / 3.7a4pre / 20100405051240 / files
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
releases
nightly linux32
nightly linux64
nightly mac
nightly win32
Explicitly remove CALayer from CARenderer when CARenderer is destroyed in order to avoid situations where the CALayer is attached to two renderers. b=556453 r=josh
layout/generic/nsPluginUtilsOSX.mm
--- a/layout/generic/nsPluginUtilsOSX.mm
+++ b/layout/generic/nsPluginUtilsOSX.mm
@@ -241,16 +241,20 @@ void cgdata_release_callback(void *aCGDa
   if (aCGData) {
     free(aCGData); 
   }
 }
 
 void nsCARenderer::Destroy() {
   if (mCARenderer) {
     CARenderer* caRenderer = (CARenderer*)mCARenderer;
+    // Bug 556453:
+    // Explicitly remove the layer from the renderer
+    // otherwise it does not always happen right away.
+    caRenderer.layer = NULL;
     [caRenderer release];
   }
   if (mPixelBuffer) {
     ::CGLDestroyPBuffer((CGLPBufferObj)mPixelBuffer);
   }
   if (mOpenGLContext) {
     ::CGLDestroyContext((CGLContextObj)mOpenGLContext);
   }