changeset 19764:80bfc233c9f2

Fix a memory corruption. Change default binding for 'jump next unread' from 'J' to 'n'. Treat 'None' in pygnt as NULL in gnt.
author Sadrul Habib Chowdhury <imadil@gmail.com>
date Wed, 12 Sep 2007 11:04:26 +0000
parents 8f8421bda08d
children 6060bc0a8cca 6829aa32b16c
files finch/libgnt/pygnt/example/rss/gntrss-ui.py finch/libgnt/pygnt/example/rss/gntrss.py finch/libgnt/pygnt/gnttree.override
diffstat 3 files changed, 9 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- 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),