comparison src/filedata.c @ 1709:b16a453bfde6

fixed vd_notify_cb leak
author nadvornik
date Fri, 28 Aug 2009 23:09:05 +0000
parents 8213f95b65c9
children 30d649102a9f
comparison
equal deleted inserted replaced
1708:8213f95b65c9 1709:b16a453bfde6
2533 } 2533 }
2534 2534
2535 gboolean file_data_register_notify_func(FileDataNotifyFunc func, gpointer data, NotifyPriority priority) 2535 gboolean file_data_register_notify_func(FileDataNotifyFunc func, gpointer data, NotifyPriority priority)
2536 { 2536 {
2537 NotifyData *nd; 2537 NotifyData *nd;
2538 GList *work = notify_func_list;
2539
2540 while (work)
2541 {
2542 NotifyData *nd = (NotifyData *)work->data;
2543
2544 if (nd->func == func && nd->data == data)
2545 {
2546 g_warning("Notify func already registered");
2547 return FALSE;
2548 }
2549 work = work->next;
2550 }
2538 2551
2539 nd = g_new(NotifyData, 1); 2552 nd = g_new(NotifyData, 1);
2540 nd->func = func; 2553 nd->func = func;
2541 nd->data = data; 2554 nd->data = data;
2542 nd->priority = priority; 2555 nd->priority = priority;
2563 return TRUE; 2576 return TRUE;
2564 } 2577 }
2565 work = work->next; 2578 work = work->next;
2566 } 2579 }
2567 2580
2581 g_warning("Notify func not found");
2568 return FALSE; 2582 return FALSE;
2569 } 2583 }
2570 2584
2571 2585
2572 void file_data_send_notification(FileData *fd, NotifyType type) 2586 void file_data_send_notification(FileData *fd, NotifyType type)