mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-03-03 07:01:19 +00:00
fix bug 126333. reduce shutdown leakage by releaseing Components object members. r=dbradley sr=alecf
This commit is contained in:
parent
813b0af271
commit
78dddf0f3b
@ -1553,6 +1553,12 @@ nsXPCComponents::nsXPCComponents()
|
||||
}
|
||||
|
||||
nsXPCComponents::~nsXPCComponents()
|
||||
{
|
||||
ClearMembers();
|
||||
}
|
||||
|
||||
void
|
||||
nsXPCComponents::ClearMembers()
|
||||
{
|
||||
NS_IF_RELEASE(mInterfaces);
|
||||
NS_IF_RELEASE(mClasses);
|
||||
|
@ -2808,10 +2808,13 @@ public:
|
||||
XPCWrappedNativeScope* aScope,
|
||||
JSObject* aGlobal);
|
||||
|
||||
void SystemIsBeingShutDown() {ClearMembers();}
|
||||
|
||||
virtual ~nsXPCComponents();
|
||||
|
||||
private:
|
||||
nsXPCComponents();
|
||||
void ClearMembers();
|
||||
|
||||
private:
|
||||
nsXPCComponents_Interfaces* mInterfaces;
|
||||
|
@ -431,6 +431,10 @@ XPCWrappedNativeScope::SystemIsBeingShutDown(XPCCallContext& ccx)
|
||||
|
||||
for(cur = gDyingScopes; cur; cur = cur->mNext)
|
||||
{
|
||||
// Give the Components object a chance to try to clean up.
|
||||
if(cur->mComponents)
|
||||
cur->mComponents->SystemIsBeingShutDown();
|
||||
|
||||
// Walk the protos first. Wrapper shutdown can leave dangling
|
||||
// proto pointers in the proto map.
|
||||
cur->mWrappedNativeProtoMap->
|
||||
|
Loading…
x
Reference in New Issue
Block a user