[gjs] context: Fix crash
- From: Jasper St. Pierre <jstpierre src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gjs] context: Fix crash
- Date: Wed, 15 Jan 2014 21:23:43 +0000 (UTC)
commit 0bdf36bb5f66fbb6debc7a6b57b2d632991084c0
Author: Jasper St. Pierre <jstpierre mecheye net>
Date: Wed Jan 15 16:23:26 2014 -0500
context: Fix crash
We need to be in a compartment to call gjs_log_exception
gjs/context.cpp | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
---
diff --git a/gjs/context.cpp b/gjs/context.cpp
index c99b583..2bafa91 100644
--- a/gjs/context.cpp
+++ b/gjs/context.cpp
@@ -593,6 +593,8 @@ gjs_context_eval(GjsContext *js_context,
gboolean ret = FALSE;
jsval retval;
+ JSAutoCompartment ac(js_context->context, js_context->global);
+
g_object_ref(G_OBJECT(js_context));
if (!gjs_eval_with_scope(js_context->context, NULL, script, script_len, filename, &retval)) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]