Exemplo n.º 1
0
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
    */

}
Exemplo n.º 2
0
/*  LASDnsFlush
 *  Given the address of a las_cookie for a DNS expression entry, frees up
 *  all allocated memory for it.  This includes the hash table, plus the
 *  context structure.
 */
void
LASDnsFlush(void **las_cookie)
{
    if (*las_cookie == NULL)
        return;

    pool_destroy(((LASDnsContext_t *)*las_cookie)->pool);
    PR_HashTableDestroy(((LASDnsContext_t *)*las_cookie)->Table);
    PERM_FREE(*las_cookie);
    *las_cookie = NULL;
    return;
}
Exemplo n.º 3
0
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;
}
Exemplo n.º 4
0
void
js_LeaveSharpObject(JSContext *cx)
{
    JSSharpObjectMap *map;

    map = &cx->sharpObjectMap;
    PR_ASSERT(map->depth > 0);
    if (--map->depth == 0) {
	map->sharpgen = 0;
	PR_HashTableDestroy(map->table);
	map->table = NULL;
    }
}