summaryrefslogtreecommitdiffstats
path: root/gfx/layers/composite/CanvasLayerComposite.cpp
diff options
context:
space:
mode:
authorwolfbeast <mcwerewolf@wolfbeast.com>2019-05-28 15:18:04 +0200
committerwolfbeast <mcwerewolf@wolfbeast.com>2019-05-28 18:22:24 +0200
commit4ad94cfde9ffbb8b32b461ed288327e17ea936c9 (patch)
treea49c7ef0adedeacd788fe4e1533ca57a0e3674d9 /gfx/layers/composite/CanvasLayerComposite.cpp
parent204a9291968bedebf780d5e20394d36830bb417e (diff)
downloadUXP-4ad94cfde9ffbb8b32b461ed288327e17ea936c9.tar
UXP-4ad94cfde9ffbb8b32b461ed288327e17ea936c9.tar.gz
UXP-4ad94cfde9ffbb8b32b461ed288327e17ea936c9.tar.lz
UXP-4ad94cfde9ffbb8b32b461ed288327e17ea936c9.tar.xz
UXP-4ad94cfde9ffbb8b32b461ed288327e17ea936c9.zip
Make extra sure Compositables don't refer back to layers after reassignment.
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;
}