[pygobject/invoke-rewrite] [gi-invoke-ng] use g_slice for allocating GValues that are caller allocated



commit 50cfccb5801c1b9a0a42ffe2826cd245f21fd88d
Author: John (J5) Palmieri <johnp redhat com>
Date:   Fri Jun 24 14:17:24 2011 -0400

    [gi-invoke-ng] use g_slice for allocating GValues that are caller allocated

 gi/pygi-invoke-ng.c       |    2 ++
 gi/pygi-marshal-cleanup.c |    2 ++
 2 files changed, 4 insertions(+), 0 deletions(-)
---
diff --git a/gi/pygi-invoke-ng.c b/gi/pygi-invoke-ng.c
index c7c0b5f..cc61308 100644
--- a/gi/pygi-invoke-ng.c
+++ b/gi/pygi-invoke-ng.c
@@ -265,6 +265,8 @@ _invoke_marshal_in_args (PyGIInvokeState *state, PyGICallableCache *cache)
                     if (iface_cache->g_type == G_TYPE_BOXED) {
                         state->args[i]->v_pointer =
                             _pygi_boxed_alloc (iface_cache->interface_info, NULL);
+                    } else if (iface_cache->g_type == G_TYPE_VALUE) {
+                        state->args[i]->v_pointer = g_slice_new0 (GValue);
                     } else if (iface_cache->is_foreign) {
                         PyObject *foreign_struct =
                             pygi_struct_foreign_convert_from_g_argument (
diff --git a/gi/pygi-marshal-cleanup.c b/gi/pygi-marshal-cleanup.c
index 6a0b6a6..21e7db5 100644
--- a/gi/pygi-marshal-cleanup.c
+++ b/gi/pygi-marshal-cleanup.c
@@ -32,6 +32,8 @@ _cleanup_caller_allocates (PyGIInvokeState    *state,
         gsize size;
         size = g_struct_info_get_size (iface_cache->interface_info);
         g_slice_free1 (size, data);
+    } else if (iface_cache->g_type == G_TYPE_VALUE) {
+        g_slice_free (GValue, data);
     } else if (iface_cache->is_foreign) {
         pygi_struct_foreign_release ((GIBaseInfo *)iface_cache->interface_info,
                                      data);



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