fix bug 126333. reduce shutdown leakage by releaseing Components object members. r=dbradley sr=alecf

This commit is contained in:
jband%netscape.com 2002-02-20 07:03:27 +00:00
parent 813b0af271
commit 78dddf0f3b
3 changed files with 13 additions and 0 deletions

View File

@ -1553,6 +1553,12 @@ nsXPCComponents::nsXPCComponents()
}
nsXPCComponents::~nsXPCComponents()
{
ClearMembers();
}
void
nsXPCComponents::ClearMembers()
{
NS_IF_RELEASE(mInterfaces);
NS_IF_RELEASE(mClasses);

View File

@ -2808,10 +2808,13 @@ public:
XPCWrappedNativeScope* aScope,
JSObject* aGlobal);
void SystemIsBeingShutDown() {ClearMembers();}
virtual ~nsXPCComponents();
private:
nsXPCComponents();
void ClearMembers();
private:
nsXPCComponents_Interfaces* mInterfaces;

View File

@ -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->