Bug 514567: Define JSAutoAtomList, a variant of JSAutoAtomList with a destructor. r=jorendorff
This commit is contained in:
@@ -1176,6 +1176,20 @@ JSAtomList::rawRemove(JSCompiler *jsc, JSAtomListElement *ale, JSHashEntry **hep
|
||||
--count;
|
||||
}
|
||||
|
||||
JSAutoAtomList::~JSAutoAtomList()
|
||||
{
|
||||
if (table) {
|
||||
JS_HashTableDestroy(table);
|
||||
} else {
|
||||
JSHashEntry *hep = list;
|
||||
while (hep) {
|
||||
JSHashEntry *next = hep->next;
|
||||
js_free_temp_entry(compiler, hep, HT_FREE_ENTRY);
|
||||
hep = next;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
JSAtomListElement *
|
||||
JSAtomListIterator::operator ()()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user