Bug 514567: Define JSAutoAtomList, a variant of JSAutoAtomList with a destructor. r=jorendorff

This commit is contained in:
Jim Blandy
2009-11-19 12:35:55 -08:00
parent 7f54c738bc
commit b0df48c263
2 changed files with 26 additions and 0 deletions

View File

@@ -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 ()()
{