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 77809 ac24c47e2885476593985c88a503e4f075602582
parent 77808 39d5bb6c6d4d3165dcb10bded80a2aa9da7cb98e
child 77810 ea0d2b03cfcf7547d6c8acbc360e47595eb90a66
push id2265
push usereakhgari@mozilla.com
push dateThu, 29 Sep 2011 14:58:29 +0000
treeherdermozilla-inbound@ea0d2b03cfcf [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);
 }