[pygtk] Make pygtk_boxed_unref_shared() also handle Py_None



commit b8b6f248286b1e4ff1179bdc4e8b810f6e9f00c5
Author: Paul Pogonyshev <pogonyshev gmx net>
Date:   Fri May 8 23:50:49 2009 +0300

    Make pygtk_boxed_unref_shared() also handle Py_None
    
    Fixes bug #523001.
---
 gtk/gtkobject-support.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/gtk/gtkobject-support.c b/gtk/gtkobject-support.c
index 32fcc75..04065d9 100644
--- a/gtk/gtkobject-support.c
+++ b/gtk/gtkobject-support.c
@@ -123,6 +123,10 @@ pygtk_target_list_to_list(GtkTargetList *targets)
 void
 pygtk_boxed_unref_shared(PyObject *boxed)
 {
+    if (boxed == Py_None) {
+        Py_DECREF(Py_None);
+        return;
+    }
     PyGBoxed *pyboxed;
     g_return_if_fail(boxed != NULL && PyObject_TypeCheck(boxed, &PyGBoxed_Type));
     pyboxed = (PyGBoxed *) boxed;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]