# HG changeset patch # User nadvornik # Date 1251500945 0 # Node ID b16a453bfde6856e8e7fd80dec50c22e5ef51389 # Parent 8213f95b65c912f44c02f53e265adf6a44227900 fixed vd_notify_cb leak diff -r 8213f95b65c9 -r b16a453bfde6 src/filedata.c --- a/src/filedata.c Fri Aug 28 20:18:46 2009 +0000 +++ b/src/filedata.c Fri Aug 28 23:09:05 2009 +0000 @@ -2535,6 +2535,19 @@ gboolean file_data_register_notify_func(FileDataNotifyFunc func, gpointer data, NotifyPriority priority) { NotifyData *nd; + GList *work = notify_func_list; + + while (work) + { + NotifyData *nd = (NotifyData *)work->data; + + if (nd->func == func && nd->data == data) + { + g_warning("Notify func already registered"); + return FALSE; + } + work = work->next; + } nd = g_new(NotifyData, 1); nd->func = func; @@ -2565,6 +2578,7 @@ work = work->next; } + g_warning("Notify func not found"); return FALSE; } diff -r 8213f95b65c9 -r b16a453bfde6 src/view_dir.c --- a/src/view_dir.c Fri Aug 28 20:18:46 2009 +0000 +++ b/src/view_dir.c Fri Aug 28 23:09:05 2009 +0000 @@ -133,9 +133,10 @@ g_signal_connect(G_OBJECT(vd->view), "button_release_event", G_CALLBACK(vd_release_cb), vd); - if (dir_fd) vd_set_fd(vd, dir_fd); + file_data_register_notify_func(vd_notify_cb, vd, NOTIFY_PRIORITY_HIGH); - file_data_register_notify_func(vd_notify_cb, vd, NOTIFY_PRIORITY_HIGH); + /* vd_set_fd expects that vd_notify_cb is already registered */ + if (dir_fd) vd_set_fd(vd, dir_fd); gtk_widget_show(vd->view);