Пример #1
0
void
gjs_keep_alive_add_global_child(JSContext         *context,
                                GjsUnrootedFunc  notify,
                                JSObject          *child,
                                void              *data)
{
    JSObject *keep_alive;

    JS_BeginRequest(context);

    keep_alive = gjs_keep_alive_get_global(context);

    gjs_keep_alive_add_child(keep_alive, notify, child, data);

    JS_EndRequest(context);
}
Пример #2
0
void
gjs_keep_alive_add_global_child(JSContext         *context,
                                GjsUnrootedFunc  notify,
                                JSObject          *child,
                                void              *data)
{
    JSObject *keep_alive;

    JS_BeginRequest(context);

    keep_alive = gjs_keep_alive_get_global(context);

    if (!keep_alive)
        keep_alive = gjs_keep_alive_create_in_global(context);

    if (!keep_alive)
        gjs_fatal("could not create keep_alive on global object, no memory?");

    gjs_keep_alive_add_child(context,
                             keep_alive,
                             notify, child, data);

    JS_EndRequest(context);
}