static void jss_release(js_setting_t *jss) { if(atomic_add(&jss->jss_refcount, -1) > 1) return; jsg_release(jss->jss_jsg); setting_destroy(jss->jss_s); free(jss); }
static void jss_release(js_setting_t *jss) { if(atomic_dec(&jss->jss_refcount)) return; jsg_release(jss->jss_jsg); setting_destroy(jss->jss_s); free(jss->jss_key); free(jss); }
static void jsg_destroy(JSContext *cx, js_setting_group_t *jsg) { js_setting_t *jss; while((jss = LIST_FIRST(&jsg->jsg_settings)) != NULL) jss_destroy(cx, jss); prop_unparent(jsg->jsg_root); LIST_REMOVE(jsg, jsg_link); JS_RemoveRoot(cx, &jsg->jsg_val); jsg_release(jsg); }
static void setting_group_finalize(JSContext *cx, JSObject *obj) { js_setting_group_t *jsg = JS_GetPrivate(cx, obj); jsg_release(jsg); }