From 8b7013b519eb97daa15b9e6858a45d6d014a99f6 Mon Sep 17 00:00:00 2001 From: Benoit Jacob Date: Wed, 27 Nov 2013 10:18:38 -0500 Subject: [PATCH] Bug 933082 - Part 3: let ShadowLayerForwarder hold a strong ref to its LayerTransactionChild - r=nical --- gfx/layers/ipc/ShadowLayers.cpp | 3 +-- gfx/layers/ipc/ShadowLayers.h | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/gfx/layers/ipc/ShadowLayers.cpp b/gfx/layers/ipc/ShadowLayers.cpp index b0dcefebf1f..f32b45c3d55 100644 --- a/gfx/layers/ipc/ShadowLayers.cpp +++ b/gfx/layers/ipc/ShadowLayers.cpp @@ -179,8 +179,7 @@ CompositableForwarder::IdentifyTextureHost(const TextureFactoryIdentifier& aIden } ShadowLayerForwarder::ShadowLayerForwarder() - : mShadowManager(nullptr) - , mDiagnosticTypes(DIAGNOSTIC_NONE) + : mDiagnosticTypes(DIAGNOSTIC_NONE) , mIsFirstPaint(false) , mWindowOverlayChanged(false) { diff --git a/gfx/layers/ipc/ShadowLayers.h b/gfx/layers/ipc/ShadowLayers.h index 10e0e9e5da3..54756cf5290 100644 --- a/gfx/layers/ipc/ShadowLayers.h +++ b/gfx/layers/ipc/ShadowLayers.h @@ -348,7 +348,7 @@ public: * True if this is forwarding to a LayerManagerComposite. */ bool HasShadowManager() const { return !!mShadowManager; } - PLayerTransactionChild* GetShadowManager() const { return mShadowManager; } + PLayerTransactionChild* GetShadowManager() const { return mShadowManager.get(); } virtual void WindowOverlayChanged() { mWindowOverlayChanged = true; } @@ -421,7 +421,7 @@ protected: void CheckSurfaceDescriptor(const SurfaceDescriptor* aDescriptor) const {} #endif - PLayerTransactionChild* mShadowManager; + RefPtr mShadowManager; #ifdef MOZ_HAVE_SURFACEDESCRIPTORGRALLOC // from ISurfaceAllocator