mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-03 22:38:41 +09:00
Issue #1860 - Follow-up: Make sure we don't add duplicate frames
Changing to vector makes manipulating display list items more risky. This is to make sure we don't inadvertently end up with duplicates in the list of display items avoiding double-free scenarios.
This commit is contained in:
parent
070b283e38
commit
f039cc7ef8
1 changed files with 6 additions and 1 deletions
|
|
@ -162,7 +162,12 @@ void
|
|||
FrameLayerBuilder::DisplayItemData::AddFrame(nsIFrame* aFrame)
|
||||
{
|
||||
MOZ_RELEASE_ASSERT(mLayer);
|
||||
mFrameList.AppendElement(aFrame);
|
||||
|
||||
// Make sure we don't add duplicate frames as we're storing these as vectors.
|
||||
// See UXP Issue #1860
|
||||
if (!mFrameList.Contains(aFrame)) {
|
||||
mFrameList.AppendElement(aFrame);
|
||||
}
|
||||
|
||||
nsTArray<DisplayItemData*>* array =
|
||||
aFrame->GetProperty(FrameLayerBuilder::LayerManagerDataProperty());
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue