Revision: 1830
          http://geeqie.svn.sourceforge.net/geeqie/?rev=1830&view=rev
Author:   nadvornik
Date:     2009-08-28 23:09:05 +0000 (Fri, 28 Aug 2009)

Log Message:
-----------
fixed vd_notify_cb leak

Modified Paths:
--------------
    trunk/src/filedata.c
    trunk/src/view_dir.c

Modified: trunk/src/filedata.c
===================================================================
--- trunk/src/filedata.c        2009-08-28 21:01:29 UTC (rev 1829)
+++ trunk/src/filedata.c        2009-08-28 23:09:05 UTC (rev 1830)
@@ -2549,7 +2549,20 @@
 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;
        nd->data = data;
@@ -2579,6 +2592,7 @@
                work = work->next;
                }
 
+       g_warning("Notify func not found");
        return FALSE;
 }
 

Modified: trunk/src/view_dir.c
===================================================================
--- trunk/src/view_dir.c        2009-08-28 21:01:29 UTC (rev 1829)
+++ trunk/src/view_dir.c        2009-08-28 23:09:05 UTC (rev 1830)
@@ -126,10 +126,11 @@
        g_signal_connect(G_OBJECT(vd->view), "button_release_event",
                         G_CALLBACK(vd_release_cb), vd);
 
+       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);
 
-       file_data_register_notify_func(vd_notify_cb, vd, NOTIFY_PRIORITY_HIGH);
-
        gtk_widget_show(vd->view);
 
        return vd;


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Geeqie-svn mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geeqie-svn

Reply via email to