[seed] Proper handle GHash
- From: Alan Knowles <alank src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [seed] Proper handle GHash
- Date: Wed, 27 Jan 2016 03:26:19 +0000 (UTC)
commit 5cbbebaa46a0fed4a21d380ebe353186820b9c9a
Author: Danilo Cesar Lemes de Paula <danilo cesar collabora co uk>
Date: Tue Jan 26 09:28:47 2016 -0200
Proper handle GHash
libseed/seed-closure.c | 2 ++
libseed/seed-types.c | 9 ++++++++-
2 files changed, 10 insertions(+), 1 deletions(-)
---
diff --git a/libseed/seed-closure.c b/libseed/seed-closure.c
index 4815cf4..0205c39 100644
--- a/libseed/seed-closure.c
+++ b/libseed/seed-closure.c
@@ -166,6 +166,7 @@ seed_handle_closure (ffi_cif * cif, void *result, void **args, gpointer userdata
}
case GI_TYPE_TAG_GLIST:
case GI_TYPE_TAG_GSLIST:
+ case GI_TYPE_TAG_GHASH:
arg->v_pointer = *(gpointer *) args[i];
break;
default:
@@ -280,6 +281,7 @@ seed_handle_closure (ffi_cif * cif, void *result, void **args, gpointer userdata
}
case GI_TYPE_TAG_GLIST:
case GI_TYPE_TAG_GSLIST:
+ case GI_TYPE_TAG_GHASH:
*(gpointer *) result = return_arg.v_pointer;
break;
default:
diff --git a/libseed/seed-types.c b/libseed/seed-types.c
index 2031589..70a3ef5 100644
--- a/libseed/seed-types.c
+++ b/libseed/seed-types.c
@@ -1221,11 +1221,18 @@ seed_value_from_gi_argument_full (JSContextRef ctx,
return JSValueMakeNull (ctx);
}
+ hash_table = arg->v_pointer;
+ if (!hash_table)
+ {
+ seed_make_exception (ctx, exception, "ArgumentError",
+ "Unable to make hash table indexed with values of type %s",
g_type_tag_to_string (key_type_tag));
+ return JSValueMakeNull (ctx);
+ }
+
value_type = g_type_info_get_param_type (type_info, 1);
ret = JSObjectMake (ctx, NULL, NULL);
- hash_table = arg->v_pointer;
g_hash_table_iter_init (&iter, hash_table);
while (g_hash_table_iter_next (&iter, &key, &value))
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]