[seed] Fixes : bug#657228 - Make callbacks work with WebkFrame's Js Context



commit b41c16b814f1c08228be08ecfa2dec0917d1696b
Author: Siraj Razick <siraj razick collabora co uk>
Date:   Wed Aug 24 16:49:56 2011 +0530

    Fixes : bug#657228 - Make callbacks work with WebkFrame's Js Context

 libseed/seed-closure.c |    6 ++++--
 libseed/seed-closure.h |    1 +
 2 files changed, 5 insertions(+), 2 deletions(-)
---
diff --git a/libseed/seed-closure.c b/libseed/seed-closure.c
index 1e6f1c4..9feb85e 100644
--- a/libseed/seed-closure.c
+++ b/libseed/seed-closure.c
@@ -42,7 +42,7 @@ seed_closure_finalize (JSObjectRef object)
 }
 
 static void
-seed_handle_closure (ffi_cif * cif, void *result, void **args, void *userdata)
+seed_handle_closure (ffi_cif * cif, void *result, void **args, gpointer userdata)
 {
   SeedNativeClosure *privates = userdata;
   gint num_args, i;
@@ -54,7 +54,8 @@ seed_handle_closure (ffi_cif * cif, void *result, void **args, void *userdata)
   GITypeInfo *arg_type;
   GITypeTag tag;
   GArgument rarg, return_arg;
-  JSContextRef ctx = JSGlobalContextCreateInGroup (context_group, 0);
+  JSContextRef ctx =  JSGlobalContextCreateInGroup (
+      JSContextGetGroup(privates->ctx), 0);
   GArgument *arg = &rarg;
   gchar *mes;
 
@@ -319,6 +320,7 @@ seed_make_native_closure (JSContextRef ctx,
   cif = g_new0 (ffi_cif, 1);
 
   privates = g_new0 (SeedNativeClosure, 1);
+  privates->ctx = ctx;
   privates->info = (GICallableInfo *) g_base_info_ref ((GIBaseInfo *) info);
   privates->function = function;
   privates->cif = cif;
diff --git a/libseed/seed-closure.h b/libseed/seed-closure.h
index d316aa5..46a4563 100644
--- a/libseed/seed-closure.h
+++ b/libseed/seed-closure.h
@@ -35,6 +35,7 @@ typedef struct _SeedClosure
 
 typedef struct _SeedNativeClosure
 {
+  JSContextRef ctx;
   GICallableInfo *info;
   JSValueRef function;
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]