summaryrefslogtreecommitdiffstats
path: root/gfx/layers/composite/CanvasLayerComposite.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'gfx/layers/composite/CanvasLayerComposite.cpp')
-rw-r--r--gfx/layers/composite/CanvasLayerComposite.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/gfx/layers/composite/CanvasLayerComposite.cpp b/gfx/layers/composite/CanvasLayerComposite.cpp
index 03a1d38..ce48281 100644
--- a/gfx/layers/composite/CanvasLayerComposite.cpp
+++ b/gfx/layers/composite/CanvasLayerComposite.cpp
@@ -40,9 +40,13 @@ CanvasLayerComposite::~CanvasLayerComposite() {
bool CanvasLayerComposite::SetCompositableHost(CompositableHost* aHost) {
switch (aHost->GetType()) {
- case CompositableType::IMAGE:
+ case CompositableType::IMAGE: {
+ if (mCompositableHost && aHost != mCompositableHost) {
+ mCompositableHost->Detach(this);
+ }
mCompositableHost = aHost;
return true;
+ }
default:
return false;
}