summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristoph Reiter <reiter.christoph@gmail.com>2018-04-18 12:27:58 +0200
committerChristoph Reiter <reiter.christoph@gmail.com>2018-04-18 12:28:34 +0200
commit33409ccdd92a35ee8ae386c0c1276f8c87b00d22 (patch)
tree0eda4d178dc732c9d2b67aec7eaf2e50b32d0c9a
parent85f1a9aa87699e2b2a57509ff9bbe132db259de8 (diff)
downloadpygobject-33409ccdd92a35ee8ae386c0c1276f8c87b00d22.tar.gz
Use Py_REFCNT() everywhere
-rw-r--r--gi/pygi-object.c2
-rw-r--r--gi/pygi-signal-closure.c2
-rw-r--r--gi/pygi-type.c2
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);