Defer deleting the current element until the next iteration so that we can
  dereference the element first to get to the next element.


git-svn-id: svn://10.0.0.236/trunk@54173 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
akhil.arora%sun.com
1999-11-22 22:01:23 +00:00
parent 2606d77b9d
commit b2ac9c284d

View File

@@ -522,20 +522,21 @@ void JavaDOMGlobals::TakeOutGarbage()
PRCList* chain = NULL;
PRCList* elem = NULL;
for (chain = garbage.next;
for (chain = PR_LIST_HEAD(&garbage);
chain != &garbage;
chain = PR_NEXT_LINK(chain)) {
elem = chain;
delete elem;
elem = chain;
domo = ((jniDOMGarbage*) elem)->domObject;
PR_LOG(log, PR_LOG_DEBUG,
("JavaDOMGlobals::TakeOutGarbage: Releasing %x\n", domo));
domo->Release();
domo = NULL;
delete elem;
count++;
}
delete elem;
PR_INIT_CLIST(&garbage);
if (count)