mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-10 03:45:46 +00:00
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.
This commit is contained in:
parent
ec924f35d9
commit
0b50b6daa1
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user