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



commit 0aa53b6d9667ab2fc8cb0e6242564e8851ef66d6
Author: Siraj Razick <siraj razick collabora co uk>
Date:   Wed Aug 31 11:54:42 2011 +0800

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

 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..d273c25 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 (
+      context_group, 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]