diff --git a/content/base/src/nsDocument.cpp b/content/base/src/nsDocument.cpp index 00bdb1914be..f94e35b90f3 100644 --- a/content/base/src/nsDocument.cpp +++ b/content/base/src/nsDocument.cpp @@ -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) diff --git a/content/base/src/nsNodeInfoManager.cpp b/content/base/src/nsNodeInfoManager.cpp index 77a62b86f94..a6a239e22a1 100644 --- a/content/base/src/nsNodeInfoManager.cpp +++ b/content/base/src/nsNodeInfoManager.cpp @@ -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(); } diff --git a/content/base/src/nsNodeInfoManager.h b/content/base/src/nsNodeInfoManager.h index dfc6bc15d73..4b7cf31f6f4 100644 --- a/content/base/src/nsNodeInfoManager.h +++ b/content/base/src/nsNodeInfoManager.h @@ -198,8 +198,6 @@ private: nsINodeInfo *mDocumentNodeInfo; // WEAK to avoid circular ownership nsRefPtr mNodeAllocator; - - static PRUint32 gNodeManagerCount; }; #endif /* nsNodeInfoManager_h___ */