Bug 690235 - Fix Mac builds with clang caused by bug 666414 not catching the stupidness of gcc4.2 (see bug 689397); r=ehsan
authorRafael Ávila de Espíndola <espindola@mozilla.com>
Thu, 29 Sep 2011 10:56:57 -0400
changeset 77834 f96e4ff817a788d80e10b7b8d83c5da9e7f9b41f
parent 77833 32e9422afd8dac2ebc3eeea3e22270f2c4ba9551
child 77835 fc7e928eaeaef372018f9cd045d45eeeeda93c0d
push id21244
push usereakhgari@mozilla.com
push dateThu, 29 Sep 2011 21:18:45 +0000
treeherdermozilla-central@af3668a89015 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersehsan
bugs690235, 666414, 689397
milestone10.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 690235 - Fix Mac builds with clang caused by bug 666414 not catching the stupidness of gcc4.2 (see bug 689397); r=ehsan
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);
 }