Commit a4a5511f authored by Ray Strode's avatar Ray Strode

jsauthority: root some locals to the context

Signed-off-by: Ray Strode's avatarRay Strode <rstrode@redhat.com>

https://bugs.freedesktop.org/show_bug.cgi?id=105865
parent 84bfad02
...@@ -317,7 +317,7 @@ load_scripts (PolkitBackendJsAuthority *authority) ...@@ -317,7 +317,7 @@ load_scripts (PolkitBackendJsAuthority *authority)
} }
/* evaluate the script */ /* evaluate the script */
JS::Value rval; JS::RootedValue rval(authority->priv->cx);
if (!execute_script_with_runaway_killer (authority, if (!execute_script_with_runaway_killer (authority,
script, script,
&rval)) &rval))
...@@ -742,7 +742,7 @@ subject_to_jsval (PolkitBackendJsAuthority *authority, ...@@ -742,7 +742,7 @@ subject_to_jsval (PolkitBackendJsAuthority *authority,
gboolean ret = FALSE; gboolean ret = FALSE;
JS::Value ret_jsval; JS::Value ret_jsval;
const char *src; const char *src;
JSObject *obj; JS::RootedObject obj(authority->priv->cx);
pid_t pid; pid_t pid;
uid_t uid; uid_t uid;
gchar *user_name = NULL; gchar *user_name = NULL;
...@@ -873,7 +873,7 @@ action_and_details_to_jsval (PolkitBackendJsAuthority *authority, ...@@ -873,7 +873,7 @@ action_and_details_to_jsval (PolkitBackendJsAuthority *authority,
gboolean ret = FALSE; gboolean ret = FALSE;
JS::Value ret_jsval; JS::Value ret_jsval;
const char *src; const char *src;
JSObject *obj; JS::RootedObject obj(authority->priv->cx);
gchar **keys; gchar **keys;
guint n; guint n;
JS::RootedObject global(authority->priv->cx, authority->priv->js_global->get ()); JS::RootedObject global(authority->priv->cx, authority->priv->js_global->get ());
...@@ -934,7 +934,7 @@ js_operation_callback (JSContext *cx) ...@@ -934,7 +934,7 @@ js_operation_callback (JSContext *cx)
{ {
PolkitBackendJsAuthority *authority = POLKIT_BACKEND_JS_AUTHORITY (JS_GetContextPrivate (cx)); PolkitBackendJsAuthority *authority = POLKIT_BACKEND_JS_AUTHORITY (JS_GetContextPrivate (cx));
JSString *val_str; JSString *val_str;
JS::Value val; JS::RootedValue val(cx);
/* This callback can be called by the runtime at any time without us causing /* This callback can be called by the runtime at any time without us causing
* it by JS_TriggerOperationCallback(). * it by JS_TriggerOperationCallback().
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment