Bug 690235 - Fix Mac builds with clang caused by bug 666414 not catching the stupidness of gcc4.2 (see bug 689397); r=ehsan a=jst
authorRafael Ávila de Espíndola <espindola@mozilla.com>
Thu, 29 Sep 2011 10:56:57 -0400
changeset 79032 485f3c637b11ad07d4fdf48eacc6092385bcfbfc
parent 79031 14c7c295a445fb6bf50af8085b0f060ea51a99e9
child 79033 79eab065f0d05710733e577dc7b715c0540ea2b1
push id78
push userclegnitto@mozilla.com
push dateFri, 16 Dec 2011 17:32:24 +0000
treeherdermozilla-release@79d24e644fdd [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersehsan, jst
bugs690235, 666414, 689397
milestone9.0a2
Bug 690235 - Fix Mac builds with clang caused by bug 666414 not catching the stupidness of gcc4.2 (see bug 689397); r=ehsan a=jst
gfx/thebes/gfxQuartzSurface.cpp
--- a/gfx/thebes/gfxQuartzSurface.cpp
+++ b/gfx/thebes/gfxQuartzSurface.cpp
@@ -149,17 +149,18 @@ already_AddRefed<gfxImageSurface> gfxQua
         return nsnull;
 
     nsRefPtr<gfxASurface> img = Wrap(surface);
 
     // cairo_quartz_surface_get_image returns a referenced image, and thebes
     // shares the refcounts of Cairo surfaces. However, Wrap also adds a
     // reference to the image. We need to remove one of these references
     // explicitly so we don't leak.
-    img->Release();
+    gfxImageSurface* imgSurface = static_cast<gfxImageSurface*> (img.forget().get());
+    imgSurface->Release();
 
-    return static_cast<gfxImageSurface*>(img.forget().get());
+    return imgSurface;
 }
 
 gfxQuartzSurface::~gfxQuartzSurface()
 {
     CGContextRelease(mCGContext);
 }