[pygobject/pygobject-3-4] Fix marshalling of arrays of struct pointers to Python



commit 97be6c0211fb1d59d47e1db11f01f3f089702ce2
Author: Carlos Garnacho <carlos lanedo com>
Date:   Tue Nov 13 18:24:28 2012 +0100

    Fix marshalling of arrays of struct pointers to Python
    
    Fill in the pointer to the struct, not the pointer to the
    array position. This makes the GdkAtom** argument in
    gtk_clipboard_wait_for_targets() work.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=678620

 gi/pygi-marshal-to-py.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/gi/pygi-marshal-to-py.c b/gi/pygi-marshal-to-py.c
index 811d8b0..950895d 100644
--- a/gi/pygi-marshal-to-py.c
+++ b/gi/pygi-marshal-to-py.c
@@ -439,7 +439,10 @@ _pygi_marshal_to_py_array (PyGIInvokeState   *state,
                                 memcpy (_struct, array_->data + i * item_size,
                                         item_size);
                                 item_arg.v_pointer = _struct;
-                            } else
+                            } else if (item_arg_cache->is_pointer)
+                                /* this is the case for GAtom* arrays */
+                                item_arg.v_pointer = g_array_index (array_, gpointer, i);
+                            else
                                 item_arg.v_pointer = array_->data + i * item_size;
                             break;
                         default:



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