Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 936981 Details for
Bug 1138372
GtkGrid top-attach property not valid
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
manual backport of upstream fix (broken out patch)
0001-Re-add-support-for-passing-GValue-s-by-reference.patch (text/plain), 4.86 KB, created by
Laszlo Ersek
on 2014-09-12 13:57:30 UTC
(
hide
)
Description:
manual backport of upstream fix (broken out patch)
Filename:
MIME Type:
Creator:
Laszlo Ersek
Created:
2014-09-12 13:57:30 UTC
Size:
4.86 KB
patch
obsolete
>From 92c7c356f2e965daf8e90c9f082a7af5ed83e7e9 Mon Sep 17 00:00:00 2001 >From: Laszlo Ersek <lersek@redhat.com> >Date: Fri, 12 Sep 2014 15:29:54 +0200 >Subject: [PATCH] Re-add support for passing GValue's by reference > >Fix special casing when marshaling from a Python held GValue >to a GValue argument intended for a function call. >The re-factoring of GValue marshaling in commit #9e47afe459df942d9f >broke this by always making a copy of the GValue. This removed the >ability to retrieve values with functions like >gtk_style_context_get_style_property. > >https://bugzilla.gnome.org/show_bug.cgi?id=701058 > >Signed-off-by: Simon Feltman <sfeltman@src.gnome.org> > >Manual port of upstream commit 466567373289e6f141709f08efa80ba588d3d64a. > >Signed-off-by: Laszlo Ersek <lersek@redhat.com> >--- > gi/pygi-argument.c | 2 +- > gi/pygi-marshal-from-py.c | 28 +++++++++++++--------------- > gi/pygi-marshal-from-py.h | 2 +- > 3 files changed, 15 insertions(+), 17 deletions(-) > >diff --git a/gi/pygi-argument.c b/gi/pygi-argument.c >index 7de90a2..8764011 100644 >--- a/gi/pygi-argument.c >+++ b/gi/pygi-argument.c >@@ -1266,7 +1266,7 @@ array_success: > pygi_marshal_from_py_gvalue (object, > &arg, > transfer, >- FALSE /*is_allocated*/); >+ FALSE /*copy_reference*/); > > } else if (g_type_is_a (type, G_TYPE_CLOSURE)) { > pygi_marshal_from_py_gclosure (object, &arg); >diff --git a/gi/pygi-marshal-from-py.c b/gi/pygi-marshal-from-py.c >index 289aff2..9f30c2a 100644 >--- a/gi/pygi-marshal-from-py.c >+++ b/gi/pygi-marshal-from-py.c >@@ -1650,7 +1650,7 @@ _pygi_marshal_from_py_interface_struct (PyGIInvokeState *state, > } else if (iface_cache->g_type == G_TYPE_VALUE) { > return pygi_marshal_from_py_gvalue(py_arg, arg, > arg_cache->transfer, >- arg_cache->is_caller_allocates); >+ TRUE /*copy_reference*/); > } else if (iface_cache->is_foreign) { > PyObject *success; > success = pygi_struct_foreign_convert_to_g_argument (py_arg, >@@ -1898,13 +1898,14 @@ pygi_marshal_from_py_gobject (PyObject *py_arg, /*in*/ > * py_arg: (in): > * arg: (out): > * transfer: >- * is_allocated: TRUE if arg->v_pointer is an already allocated GValue >+ * copy_reference: TRUE if arg should use the pointer reference held by py_arg >+ * when it is already holding a GValue vs. copying the value. > */ > gboolean > pygi_marshal_from_py_gvalue (PyObject *py_arg, > GIArgument *arg, > GITransfer transfer, >- gboolean is_allocated) { >+ gboolean copy_reference) { > GValue *value; > GType object_type; > >@@ -1914,24 +1915,21 @@ pygi_marshal_from_py_gvalue (PyObject *py_arg, > return FALSE; > } > >- if (is_allocated) >- value = (GValue *)arg->v_pointer; >- else >- value = g_slice_new0 (GValue); >- > /* if already a gvalue, use that, else marshal into gvalue */ > if (object_type == G_TYPE_VALUE) { > GValue *source_value = pyg_boxed_get (py_arg, GValue); >- if (G_VALUE_TYPE (value) == G_TYPE_INVALID) >+ if (copy_reference) { >+ value = source_value; >+ } else { >+ value = g_slice_new0 (GValue); > g_value_init (value, G_VALUE_TYPE (source_value)); >- g_value_copy (source_value, value); >+ g_value_copy (source_value, value); >+ } > } else { >- if (G_VALUE_TYPE (value) == G_TYPE_INVALID) >- g_value_init (value, object_type); >- >+ value = g_slice_new0 (GValue); >+ g_value_init (value, object_type); > if (pyg_value_from_pyobject (value, py_arg) < 0) { >- if (!is_allocated) >- g_slice_free (GValue, value); >+ g_slice_free (GValue, value); > PyErr_SetString (PyExc_RuntimeError, "PyObject conversion to GValue failed"); > return FALSE; > } >diff --git a/gi/pygi-marshal-from-py.h b/gi/pygi-marshal-from-py.h >index e0a57d3..48342c2 100644 >--- a/gi/pygi-marshal-from-py.h >+++ b/gi/pygi-marshal-from-py.h >@@ -193,7 +193,7 @@ gboolean pygi_marshal_from_py_gobject (PyObject *py_arg, /*in*/ > gboolean pygi_marshal_from_py_gvalue (PyObject *py_arg, /*in*/ > GIArgument *arg, /*out*/ > GITransfer transfer, >- gboolean is_allocated); >+ gboolean copy_reference); > > gboolean pygi_marshal_from_py_gclosure(PyObject *py_arg, /*in*/ > GIArgument *arg); /*out*/ >-- >1.8.3.1 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 1138372
:
935285
| 936981