diff options
author | wolfbeast <mcwerewolf@wolfbeast.com> | 2019-05-28 15:18:04 +0200 |
---|---|---|
committer | wolfbeast <mcwerewolf@wolfbeast.com> | 2019-05-28 18:22:24 +0200 |
commit | 4ad94cfde9ffbb8b32b461ed288327e17ea936c9 (patch) | |
tree | a49c7ef0adedeacd788fe4e1533ca57a0e3674d9 /gfx/layers/composite/PaintedLayerComposite.cpp | |
parent | 204a9291968bedebf780d5e20394d36830bb417e (diff) | |
download | UXP-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/PaintedLayerComposite.cpp')
-rw-r--r-- | gfx/layers/composite/PaintedLayerComposite.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/gfx/layers/composite/PaintedLayerComposite.cpp b/gfx/layers/composite/PaintedLayerComposite.cpp index b58f5d690..232cc4ef4 100644 --- a/gfx/layers/composite/PaintedLayerComposite.cpp +++ b/gfx/layers/composite/PaintedLayerComposite.cpp @@ -49,9 +49,14 @@ PaintedLayerComposite::SetCompositableHost(CompositableHost* aHost) switch (aHost->GetType()) { case CompositableType::CONTENT_TILED: case CompositableType::CONTENT_SINGLE: - case CompositableType::CONTENT_DOUBLE: - mBuffer = static_cast<ContentHost*>(aHost); + case CompositableType::CONTENT_DOUBLE: { + ContentHost* newBuffer = static_cast<ContentHost*>(aHost); + if (mBuffer && newBuffer != mBuffer) { + mBuffer->Detach(this); + } + mBuffer = newBuffer; return true; + } default: return false; } |