diff options
author | wolfbeast <mcwerewolf@wolfbeast.com> | 2019-05-28 15:18:04 +0200 |
---|---|---|
committer | wolfbeast <mcwerewolf@wolfbeast.com> | 2019-05-28 15:18:04 +0200 |
commit | 9b655e3666a6eae6f217e584ef3915c8ff99ddc1 (patch) | |
tree | 31861f345384317ea7a99e1520e24519f9c07304 /gfx/layers/composite/PaintedLayerComposite.cpp | |
parent | 65991dc1f2d197bed4657780d7f3b0204a78bb4e (diff) | |
download | UXP-9b655e3666a6eae6f217e584ef3915c8ff99ddc1.tar UXP-9b655e3666a6eae6f217e584ef3915c8ff99ddc1.tar.gz UXP-9b655e3666a6eae6f217e584ef3915c8ff99ddc1.tar.lz UXP-9b655e3666a6eae6f217e584ef3915c8ff99ddc1.tar.xz UXP-9b655e3666a6eae6f217e584ef3915c8ff99ddc1.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; } |