[pygobject] Fix marshalling of arrays of struct pointers to Python



commit 55070cc9c98993ccda7ebcb05783fad182b2eb11
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]