comparison src/filedata.c @ 1730:67145eade000

fixed vd_notify_cb leak
author nadvornik
date Fri, 28 Aug 2009 23:09:05 +0000
parents 672ee190869e
children 77415a49cd99
comparison
equal deleted inserted replaced
1729:672ee190869e 1730:67145eade000
2547 } 2547 }
2548 2548
2549 gboolean file_data_register_notify_func(FileDataNotifyFunc func, gpointer data, NotifyPriority priority) 2549 gboolean file_data_register_notify_func(FileDataNotifyFunc func, gpointer data, NotifyPriority priority)
2550 { 2550 {
2551 NotifyData *nd; 2551 NotifyData *nd;
2552 GList *work = notify_func_list;
2553
2554 while (work)
2555 {
2556 NotifyData *nd = (NotifyData *)work->data;
2557
2558 if (nd->func == func && nd->data == data)
2559 {
2560 g_warning("Notify func already registered");
2561 return FALSE;
2562 }
2563 work = work->next;
2564 }
2552 2565
2553 nd = g_new(NotifyData, 1); 2566 nd = g_new(NotifyData, 1);
2554 nd->func = func; 2567 nd->func = func;
2555 nd->data = data; 2568 nd->data = data;
2556 nd->priority = priority; 2569 nd->priority = priority;
2577 return TRUE; 2590 return TRUE;
2578 } 2591 }
2579 work = work->next; 2592 work = work->next;
2580 } 2593 }
2581 2594
2595 g_warning("Notify func not found");
2582 return FALSE; 2596 return FALSE;
2583 } 2597 }
2584 2598
2585 2599
2586 void file_data_send_notification(FileData *fd, NotifyType type) 2600 void file_data_send_notification(FileData *fd, NotifyType type)