19578 r=akhil.arora@sun.com fix=Denis Sharypov <sdv@sparc.spb.su>
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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user