mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
bug 1120285 - correctly shutdown outer doc accessible proxies r=davidb
This commit is contained in:
parent
60d7115c86
commit
e19883e24b
@ -155,10 +155,12 @@ DocAccessibleParent::ShutdownAccessibles(ProxyEntry* entry, void*)
|
||||
}
|
||||
|
||||
void
|
||||
DocAccessibleParent::ActorDestroy(ActorDestroyReason aWhy)
|
||||
DocAccessibleParent::Destroy()
|
||||
{
|
||||
MOZ_ASSERT(mChildDocs.IsEmpty(),
|
||||
"why wheren't the child docs destroyed already?");
|
||||
MOZ_ASSERT(!mShutdown);
|
||||
mShutdown = true;
|
||||
|
||||
mAccessibles.EnumerateEntries(ShutdownAccessibles, nullptr);
|
||||
ProxyDestroyed(this);
|
||||
|
@ -26,7 +26,7 @@ class DocAccessibleParent : public ProxyAccessible,
|
||||
{
|
||||
public:
|
||||
DocAccessibleParent() :
|
||||
ProxyAccessible(this), mParentDoc(nullptr)
|
||||
ProxyAccessible(this), mParentDoc(nullptr), mShutdown(false)
|
||||
{ MOZ_COUNT_CTOR_INHERITED(DocAccessibleParent, ProxyAccessible); }
|
||||
~DocAccessibleParent()
|
||||
{
|
||||
@ -45,7 +45,12 @@ public:
|
||||
virtual bool RecvShowEvent(const ShowEventData& aData) MOZ_OVERRIDE;
|
||||
virtual bool RecvHideEvent(const uint64_t& aRootID) MOZ_OVERRIDE;
|
||||
|
||||
virtual void ActorDestroy(ActorDestroyReason aWhy) MOZ_OVERRIDE;
|
||||
void Destroy();
|
||||
virtual void ActorDestroy(ActorDestroyReason aWhy) MOZ_OVERRIDE
|
||||
{
|
||||
if (!mShutdown)
|
||||
Destroy();
|
||||
}
|
||||
|
||||
/*
|
||||
* Return the main processes representation of the parent document (if any)
|
||||
@ -115,6 +120,7 @@ private:
|
||||
* proxy object so we can't use a real map.
|
||||
*/
|
||||
nsTHashtable<ProxyEntry> mAccessibles;
|
||||
bool mShutdown;
|
||||
};
|
||||
|
||||
}
|
||||
|
@ -23,6 +23,11 @@ ProxyAccessible::Shutdown()
|
||||
uint32_t childCount = mChildren.Length();
|
||||
for (uint32_t idx = 0; idx < childCount; idx++)
|
||||
mChildren[idx]->Shutdown();
|
||||
} else {
|
||||
if (mChildren.Length() != 1)
|
||||
MOZ_CRASH("outer doc doesn't own adoc!");
|
||||
|
||||
static_cast<DocAccessibleParent*>(mChildren[0])->Destroy();
|
||||
}
|
||||
|
||||
mChildren.Clear();
|
||||
|
Loading…
Reference in New Issue
Block a user