зеркало из https://github.com/mozilla/gecko-dev.git
Free remaining stack items in destructor to fix leaking pretty much everything. b=230264 r=caillon sr=bryner
This commit is contained in:
Родитель
26454ef8ab
Коммит
4bc6810bf9
|
@ -54,26 +54,36 @@
|
|||
|
||||
////////////////////////////////////////////////////
|
||||
|
||||
inDeepTreeWalker::inDeepTreeWalker()
|
||||
MOZ_DECL_CTOR_COUNTER(DeepTreeStackItem)
|
||||
|
||||
struct DeepTreeStackItem
|
||||
{
|
||||
DeepTreeStackItem() { MOZ_COUNT_CTOR(DeepTreeStackItem); }
|
||||
~DeepTreeStackItem() { MOZ_COUNT_DTOR(DeepTreeStackItem); }
|
||||
|
||||
nsCOMPtr<nsIDOMNode> node;
|
||||
nsCOMPtr<nsIDOMNodeList> kids;
|
||||
PRUint32 lastIndex;
|
||||
};
|
||||
|
||||
////////////////////////////////////////////////////
|
||||
|
||||
inDeepTreeWalker::inDeepTreeWalker()
|
||||
: mShowAnonymousContent(PR_FALSE),
|
||||
mShowSubDocuments(PR_FALSE),
|
||||
mWhatToShow(nsIDOMNodeFilter::SHOW_ALL)
|
||||
{
|
||||
mShowAnonymousContent = PR_FALSE;
|
||||
mShowSubDocuments = PR_FALSE;
|
||||
mWhatToShow = nsIDOMNodeFilter::SHOW_ALL;
|
||||
}
|
||||
|
||||
inDeepTreeWalker::~inDeepTreeWalker()
|
||||
{
|
||||
for (PRInt32 i = mStack.Count() - 1; i >= 0; --i) {
|
||||
delete NS_STATIC_CAST(DeepTreeStackItem*, mStack[i]);
|
||||
}
|
||||
}
|
||||
|
||||
NS_IMPL_ISUPPORTS1(inDeepTreeWalker, inIDeepTreeWalker)
|
||||
|
||||
typedef struct _DeepTreeStackItem
|
||||
{
|
||||
nsCOMPtr<nsIDOMNode> node;
|
||||
nsCOMPtr<nsIDOMNodeList> kids;
|
||||
PRUint32 lastIndex;
|
||||
} DeepTreeStackItem;
|
||||
|
||||
////////////////////////////////////////////////////
|
||||
// inIDeepTreeWalker
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче