Bug 664470, unlink document some more, r=peterv

--HG--
extra : rebase_source : dbafa0618f381c4dc9360f972676de137d2d9885
This commit is contained in:
Olli Pettay 2011-07-01 17:05:37 +03:00
Родитель 5898e198ad
Коммит 490dd13783
1 изменённых файлов: 18 добавлений и 5 удалений

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

@ -1917,6 +1917,8 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(nsDocument)
}
tmp->mFirstChild = nsnull;
NS_IMPL_CYCLE_COLLECTION_UNLINK_NSCOMPTR(mScriptEventManager)
NS_IMPL_CYCLE_COLLECTION_UNLINK_NSCOMPTR(mXPathEvaluatorTearoff)
NS_IMPL_CYCLE_COLLECTION_UNLINK_NSCOMPTR(mCachedRootElement)
NS_IMPL_CYCLE_COLLECTION_UNLINK_NSCOMPTR(mDisplayDocument)
NS_IMPL_CYCLE_COLLECTION_UNLINK_NSCOMPTR(mFirstBaseNodeWithHref)
@ -1939,16 +1941,27 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(nsDocument)
tmp->mBoxObjectTable = nsnull;
}
if (tmp->mListenerManager) {
tmp->mListenerManager->Disconnect();
tmp->mListenerManager = nsnull;
}
if (tmp->mSubDocuments) {
PL_DHashTableDestroy(tmp->mSubDocuments);
tmp->mSubDocuments = nsnull;
}
tmp->mAnimationFrameListeners.Clear();
tmp->mRadioGroups.Clear();
// nsDocument has a pretty complex destructor, so we're going to
// assume that *most* cycles you actually want to break somewhere
// else, and not unlink an awful lot here.
//
// In rare cases where you think an unlink will help here, add one
// manually.
tmp->mInUnlinkOrDeletion = PR_FALSE;
tmp->mIdentifierMap.Clear();
tmp->mInUnlinkOrDeletion = PR_FALSE;
NS_IMPL_CYCLE_COLLECTION_UNLINK_END