mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-10-22 07:07:30 +09:00
Avoid multiple hashtable lookups in DisplayItemData destructor
UXP has: MOZ_RELEASE_ASSERT(sAliveDisplayItemDatas && sAliveDisplayItemDatas >Contains(this)); sAliveDisplayItemDatas->RemoveEntry(this); and this gets hit during frame destruction. Combine these checks.
This commit is contained in:
parent
1be77e0f3f
commit
22d77a3d80
1 changed files with 7 additions and 2 deletions
|
|
@ -272,8 +272,13 @@ FrameLayerBuilder::DisplayItemData::~DisplayItemData()
|
||||||
array->RemoveElement(this);
|
array->RemoveElement(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
MOZ_RELEASE_ASSERT(sAliveDisplayItemDatas && sAliveDisplayItemDatas->Contains(this));
|
MOZ_RELEASE_ASSERT(sAliveDisplayItemDatas);
|
||||||
sAliveDisplayItemDatas->RemoveEntry(this);
|
nsPtrHashKey<mozilla::FrameLayerBuilder::DisplayItemData>* entry
|
||||||
|
= sAliveDisplayItemDatas->GetEntry(this);
|
||||||
|
MOZ_RELEASE_ASSERT(entry);
|
||||||
|
|
||||||
|
sAliveDisplayItemDatas->RemoveEntry(entry);
|
||||||
|
|
||||||
if (sAliveDisplayItemDatas->Count() == 0) {
|
if (sAliveDisplayItemDatas->Count() == 0) {
|
||||||
delete sAliveDisplayItemDatas;
|
delete sAliveDisplayItemDatas;
|
||||||
sAliveDisplayItemDatas = nullptr;
|
sAliveDisplayItemDatas = nullptr;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue