From 33409ccdd92a35ee8ae386c0c1276f8c87b00d22 Mon Sep 17 00:00:00 2001 From: Christoph Reiter Date: Wed, 18 Apr 2018 12:27:58 +0200 Subject: Use Py_REFCNT() everywhere --- gi/pygi-object.c | 2 +- gi/pygi-signal-closure.c | 2 +- gi/pygi-type.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/gi/pygi-object.c b/gi/pygi-object.c index aa9ac48d..bd5e0859 100644 --- a/gi/pygi-object.c +++ b/gi/pygi-object.c @@ -96,7 +96,7 @@ pygi_arg_gobject_out_arg_from_py (PyObject *py_arg, /*in*/ * https://bugzilla.gnome.org/show_bug.cgi?id=693393 */ gobj = arg->v_pointer; - if (py_arg->ob_refcnt == 1 && gobj->ref_count == 1) { + if (Py_REFCNT (py_arg) == 1 && gobj->ref_count == 1) { /* If both object ref counts are only 1 at this point (the reference held * in a return tuple), we assume the GObject will be free'd before reaching * its target and become invalid. So instead of getting invalid object errors diff --git a/gi/pygi-signal-closure.c b/gi/pygi-signal-closure.c index d34044d2..d553d764 100644 --- a/gi/pygi-signal-closure.c +++ b/gi/pygi-signal-closure.c @@ -224,7 +224,7 @@ pygi_signal_closure_marshal(GClosure *closure, list_item = pass_by_ref_structs; while (list_item) { PyObject *item = list_item->data; - if (item->ob_refcnt > 1) { + if (Py_REFCNT (item) > 1) { pygi_boxed_copy_in_place ((PyGIBoxed *)item); } list_item = g_slist_next (list_item); diff --git a/gi/pygi-type.c b/gi/pygi-type.c index 0c5a428f..3ca0fc82 100644 --- a/gi/pygi-type.c +++ b/gi/pygi-type.c @@ -1055,7 +1055,7 @@ pyg_signal_class_closure_marshal(GClosure *closure, for (i = 0; i < len; i++) { PyObject *item = PyTuple_GetItem(params, i); if (item != NULL && PyObject_TypeCheck(item, &PyGBoxed_Type) - && item->ob_refcnt != 1) { + && Py_REFCNT (item) != 1) { PyGBoxed* boxed_item = (PyGBoxed*)item; if (!boxed_item->free_on_dealloc) { gpointer boxed_ptr = pyg_boxed_get_ptr (boxed_item); -- cgit v1.2.1