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 77859 ac24c47e2885476593985c88a503e4f075602582
parent 77858 39d5bb6c6d4d3165dcb10bded80a2aa9da7cb98e
child 77860 ea0d2b03cfcf7547d6c8acbc360e47595eb90a66
push id3
push userfelipc@gmail.com
push dateFri, 30 Sep 2011 20:09:13 +0000
reviewersehsan
bugs690235, 666414, 689397
milestone10.0a1
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);
 }