summaryrefslogtreecommitdiff
path: root/gobjectmodule.c
diff options
context:
space:
mode:
authorMatt Wilson <msw@redhat.com>2002-01-11 20:56:57 +0000
committerMatt Wilson <msw@src.gnome.org>2002-01-11 20:56:57 +0000
commit6dc1d0932f163c5e1cb9b863a21dd5cc133f0e70 (patch)
tree105196ed9e3ee91dfe904ba7052b229d8988ff78 /gobjectmodule.c
parentbc5d0f92c456455b88c6313789083c8ab10c29c1 (diff)
downloadpygtk-6dc1d0932f163c5e1cb9b863a21dd5cc133f0e70.tar.gz
removed debugging code I didn't mean to check in.
2002-01-11 Matt Wilson <msw@redhat.com> * gtk/gtk.override (_wrap_gtk_toolbar_insert_stock): removed debugging code I didn't mean to check in. * gobjectmodule.c (pyg_closure_new): use PyTuple_SetItem to build the tuple if extra_args isn't one. It's faster than using abstractions and clarifies ownership rules, so we always incref extra_args even if we're about to wrap it in a tuple. Fixes crashes when passing callback functions into GtkToolbar.{append_item,prepend_item,insert_item,insert_stock, append_element}
Diffstat (limited to 'gobjectmodule.c')
-rw-r--r--gobjectmodule.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/gobjectmodule.c b/gobjectmodule.c
index 94409154..2532709b 100644
--- a/gobjectmodule.c
+++ b/gobjectmodule.c
@@ -1094,12 +1094,11 @@ pyg_closure_new(PyObject *callback, PyObject *extra_args, PyObject *swap_data)
Py_INCREF(callback);
((PyGClosure *)closure)->callback = callback;
if (extra_args && extra_args != Py_None) {
+ Py_INCREF(extra_args);
if (!PyTuple_Check(extra_args)) {
PyObject *tmp = PyTuple_New(1);
- PySequence_SetItem(tmp, 0, extra_args);
+ PyTuple_SetItem(tmp, 0, extra_args);
extra_args = tmp;
- } else {
- Py_INCREF(extra_args);
}
((PyGClosure *)closure)->extra_args = extra_args;
}