Fix a memory corruption.

Wed, 12 Sep 2007 11:04:26 +0000

author
Sadrul Habib Chowdhury <sadrul@pidgin.im>
date
Wed, 12 Sep 2007 11:04:26 +0000
changeset 19965
e4de5a1d84a5
parent 19964
fad1d38b89d2
child 19966
a9ae1df22872
child 20309
b4984f2ca5d4

Fix a memory corruption.
Change default binding for 'jump next unread' from 'J' to 'n'.
Treat 'None' in pygnt as NULL in gnt.

finch/libgnt/pygnt/example/rss/gntrss-ui.py file | annotate | diff | comparison | revisions
finch/libgnt/pygnt/example/rss/gntrss.py file | annotate | diff | comparison | revisions
finch/libgnt/pygnt/gnttree.override file | annotate | diff | comparison | revisions
--- a/finch/libgnt/pygnt/example/rss/gntrss-ui.py	Wed Sep 12 09:45:16 2007 +0000
+++ b/finch/libgnt/pygnt/example/rss/gntrss-ui.py	Wed Sep 12 11:04:26 2007 +0000
@@ -54,7 +54,7 @@
     }
 
     __gntbindings__ = {
-        'jump-next-unread' : ('jump_next_unread', 'J')
+        'jump-next-unread' : ('jump_next_unread', 'n')
     }
 
     def jump_next_unread(self, null):
--- a/finch/libgnt/pygnt/example/rss/gntrss.py	Wed Sep 12 09:45:16 2007 +0000
+++ b/finch/libgnt/pygnt/example/rss/gntrss.py	Wed Sep 12 11:04:26 2007 +0000
@@ -129,6 +129,9 @@
         self.pending = False
         self._refresh = {'time' : 30, 'id' : 0}
 
+    def __del__(self):
+        pass
+
     def do_set_property(self, property, value):
         if property.name == 'link':
             self.link = value
--- a/finch/libgnt/pygnt/gnttree.override	Wed Sep 12 09:45:16 2007 +0000
+++ b/finch/libgnt/pygnt/gnttree.override	Wed Sep 12 11:04:26 2007 +0000
@@ -51,7 +51,6 @@
 	while (list) {
 		PyObject *obj = list->data;
 		PyList_Append(py_list, obj);
-		Py_DECREF(obj);
 		list = list->next;
 	}
 	return py_list;
@@ -89,6 +88,11 @@
 		Py_DECREF(item);
 	}
 
+	if (parent == Py_None)
+		parent = NULL;
+	if (bigbro == Py_None)
+		bigbro = NULL;
+
 	list = g_list_reverse(list);
 	row = gnt_tree_create_row_from_list(GNT_TREE(self->obj), list);
 	gnt_tree_add_row_after(GNT_TREE(self->obj),

mercurial