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 16:56:39 +00:00
Родитель 17532f905b
Коммит 27794791e1
3 изменённых файлов: 3 добавлений и 22 удалений

Просмотреть файл

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

Просмотреть файл

@ -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();
}

Просмотреть файл

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