summaryrefslogtreecommitdiffstats
path: root/gobject/pygobject.c
diff options
context:
space:
mode:
Diffstat (limited to 'gobject/pygobject.c')
-rw-r--r--gobject/pygobject.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/gobject/pygobject.c b/gobject/pygobject.c
index a17762d..27f82f6 100644
--- a/gobject/pygobject.c
+++ b/gobject/pygobject.c
@@ -2011,12 +2011,13 @@ pygobject_setattro(PyObject *self, PyObject *name, PyObject *value)
{
int res;
PyGObject *gself = (PyGObject *) self;
- if (gself->inst_dict == NULL) {
+ PyObject *inst_dict_before = gself->inst_dict;
+ /* call parent type's setattro */
+ res = PyGObject_Type.tp_base->tp_setattro(self, name, value);
+ if (inst_dict_before == NULL && gself->inst_dict != NULL) {
if (G_LIKELY(gself->obj))
pygobject_switch_to_toggle_ref(gself);
}
- /* call parent type's setattro */
- res = PyGObject_Type.tp_base->tp_setattro(self, name, value);
return res;
}