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 3c8299e05..86f25b1ee 100644
--- a/gfx/layers/composite/CanvasLayerComposite.cpp
+++ b/gfx/layers/composite/CanvasLayerComposite.cpp
@@ -43,9 +43,13 @@ 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;
}