From 2d8aaafab998a7cb96525c8324040e8e18a4fa9c Mon Sep 17 00:00:00 2001 From: "peterv@propagandism.org" Date: Fri, 21 Aug 2009 15:51:08 +0300 Subject: [PATCH] Bug 461640 - Box objects should participate in cycle collection, r=smaug --HG-- extra : rebase_source : 337d82f08d17641dd4306c55743a076f53a4a22f --- layout/xul/base/src/nsBoxObject.cpp | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/layout/xul/base/src/nsBoxObject.cpp b/layout/xul/base/src/nsBoxObject.cpp index b7c9eb71c345..fe058146f0f7 100644 --- a/layout/xul/base/src/nsBoxObject.cpp +++ b/layout/xul/base/src/nsBoxObject.cpp @@ -78,10 +78,22 @@ NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(nsBoxObject) NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(BoxObject) NS_INTERFACE_MAP_END -NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(nsBoxObject) -NS_IMPL_CYCLE_COLLECTION_UNLINK_END +PR_STATIC_CALLBACK(PLDHashOperator) +PropertyTraverser(const nsAString& aKey, nsISupports* aProperty, void* userArg) +{ + nsCycleCollectionTraversalCallback *cb = + static_cast(userArg); + cb->NoteXPCOMChild(aProperty); + + return PL_DHASH_NEXT; +} + +NS_IMPL_CYCLE_COLLECTION_UNLINK_0(nsBoxObject) NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(nsBoxObject) + if (tmp->mPropertyTable) { + tmp->mPropertyTable->EnumerateRead(PropertyTraverser, &cb); + } NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END // Constructors/Destructors