diff --git a/gfx/thebes/gfxReusableSurfaceWrapper.cpp b/gfx/thebes/gfxReusableSurfaceWrapper.cpp index a4791973cb4..4a570fd7ef9 100644 --- a/gfx/thebes/gfxReusableSurfaceWrapper.cpp +++ b/gfx/thebes/gfxReusableSurfaceWrapper.cpp @@ -15,24 +15,25 @@ gfxReusableSurfaceWrapper::gfxReusableSurfaceWrapper(gfxImageSurface* aSurface) MOZ_COUNT_CTOR(gfxReusableSurfaceWrapper); } +class DeleteImageOnMainThread : public nsRunnable { +public: + DeleteImageOnMainThread(gfxImageSurface *aImage) + : mImage(aImage) + {} + + NS_IMETHOD Run() + { + return NS_OK; + } +private: + nsRefPtr mImage; +}; + gfxReusableSurfaceWrapper::~gfxReusableSurfaceWrapper() { NS_ABORT_IF_FALSE(mReadCount == 0, "Should not be locked when released"); MOZ_COUNT_DTOR(gfxReusableSurfaceWrapper); if (!NS_IsMainThread()) { - class DeleteImageOnMainThread : public nsRunnable { - public: - DeleteImageOnMainThread(gfxImageSurface *aImage) - : mImage(aImage) - {} - - NS_IMETHOD Run() - { - return NS_OK; - } - private: - nsRefPtr mImage; - }; NS_DispatchToMainThread(new DeleteImageOnMainThread(mSurface)); } }