static void _destroyJSDContext(JSDContext* jsdc) { JSD_ASSERT_VALID_CONTEXT(jsdc); JSD_LOCK(); PR_REMOVE_LINK(&jsdc->links); JSD_UNLOCK(); if( jsdc->jscontexts ) { PR_HashTableEnumerateEntries(jsdc->jscontexts, _hash_entry_zapper, NULL); PR_HashTableDestroy(jsdc->jscontexts); } jsdc->inited = JS_FALSE; /* * We should free jsdc here, but we let it leak in case there are any * asynchronous hooks calling into the system using it as a handle * * XXX we also leak the locks */ }
void js_MarkAtomState(JSRuntime *rt, JSAtomMarker mark) { PRHashTable *table; MarkAtomArgs args; table = rt->atomState.table; if (!table) return; args.runtime = rt; args.mark = mark; PR_HashTableEnumerateEntries(table, js_atom_key_marker, &args); }
void js_FreeAtomState(JSContext *cx, JSAtomState *state) { PRHashTable *table; js_ForceGC(cx); table = state->table; PR_HashTableEnumerateEntries(table, js_atom_key_zapper, NULL); js_ForceGC(cx); PR_HashTableDestroy(table); state->table = NULL; state->number = 0; }