Part of fix for bug 412491 (function objects cloned by XPConnect still keep hidden window alive late into shutdown). r/sr=sicking.

This commit is contained in:
peterv@propagandism.org 2008-01-20 08:56:39 -08:00
parent 688cb6d061
commit d07d2dea7c
3 changed files with 3 additions and 22 deletions

View File

@ -152,7 +152,6 @@ static NS_DEFINE_CID(kDOMEventGroupCID, NS_DOMEVENTGROUP_CID);
#include "nsIDOMXPathEvaluator.h"
#include "nsDOMCID.h"
#include "nsLayoutStatics.h"
#include "nsIJSContextStack.h"
#include "nsIXPConnect.h"
#include "nsCycleCollector.h"
@ -772,7 +771,6 @@ nsDocument::nsDocument(const char* aContentType)
mChildren(nsnull),
mVisible(PR_TRUE)
{
nsLayoutStatics::AddRef();
mContentType = aContentType;
#ifdef PR_LOGGING
@ -881,7 +879,6 @@ nsDocument::~nsDocument()
delete mHeaderData;
delete mBoxObjectTable;
delete mContentWrapperHash;
nsLayoutStatics::Release();
}
NS_IMPL_CYCLE_COLLECTION_CLASS(nsDocument)

View File

@ -54,6 +54,7 @@
#include "prbit.h"
#include "plarena.h"
#include "nsMemory.h"
#include "nsLayoutStatics.h"
#define NS_SMALL_NODE_ARENA_SIZE \
(512 * (sizeof(void*)/4))
@ -219,8 +220,6 @@ nsDOMNodeAllocator::Free(size_t aSize, void* aPtr)
#endif
}
PRUint32 nsNodeInfoManager::gNodeManagerCount;
PLHashNumber
nsNodeInfoManager::GetNodeInfoInnerHashValue(const void *key)
{
@ -257,36 +256,23 @@ nsNodeInfoManager::nsNodeInfoManager()
mCommentNodeInfo(nsnull),
mDocumentNodeInfo(nsnull)
{
++gNodeManagerCount;
nsLayoutStatics::AddRef();
mNodeInfoHash = PL_NewHashTable(32, GetNodeInfoInnerHashValue,
NodeInfoInnerKeyCompare,
PL_CompareValues, nsnull, nsnull);
#ifdef DEBUG_jst
printf ("Creating NodeInfoManager, gcount = %d\n", gNodeManagerCount);
#endif
}
nsNodeInfoManager::~nsNodeInfoManager()
{
--gNodeManagerCount;
if (mNodeInfoHash)
PL_HashTableDestroy(mNodeInfoHash);
if (gNodeManagerCount == 0) {
nsNodeInfo::ClearCache();
}
// Note: mPrincipal may be null here if we never got inited correctly
NS_IF_RELEASE(mPrincipal);
#ifdef DEBUG_jst
printf ("Removing NodeInfoManager, gcount = %d\n", gNodeManagerCount);
#endif
nsLayoutStatics::Release();
}

View File

@ -198,8 +198,6 @@ private:
nsINodeInfo *mDocumentNodeInfo; // WEAK to avoid circular ownership
nsRefPtr<nsDOMNodeAllocator> mNodeAllocator;
static PRUint32 gNodeManagerCount;
};
#endif /* nsNodeInfoManager_h___ */