comparison gtk/gtkblist.c @ 15221:152756b02fca

[gaim-migrate @ 18010] Do not use gtkblist after freeing and setting it to NULL. Disconnect from the all signals when uniniting. committer: Tailor Script <tailor@pidgin.im>
author Sadrul Habib Chowdhury <imadil@gmail.com>
date Sat, 16 Dec 2006 09:58:26 +0000
parents c9bb2131bdf3
children 26357b7f117e
comparison
equal deleted inserted replaced
15220:4bf7801a2539 15221:152756b02fca
4792 } 4792 }
4793 } 4793 }
4794 4794
4795 static void gaim_gtk_blist_update(GaimBuddyList *list, GaimBlistNode *node) 4795 static void gaim_gtk_blist_update(GaimBuddyList *list, GaimBlistNode *node)
4796 { 4796 {
4797 if (list)
4798 gtkblist = GAIM_GTK_BLIST(list);
4797 if(!gtkblist || !node) 4799 if(!gtkblist || !node)
4798 return; 4800 return;
4799 4801
4800 if (node->ui_data == NULL) 4802 if (node->ui_data == NULL)
4801 gaim_gtk_blist_new_node(node); 4803 gaim_gtk_blist_new_node(node);
4826 static void gaim_gtk_blist_destroy(GaimBuddyList *list) 4828 static void gaim_gtk_blist_destroy(GaimBuddyList *list)
4827 { 4829 {
4828 if (!gtkblist) 4830 if (!gtkblist)
4829 return; 4831 return;
4830 4832
4831 gaim_signal_disconnect(gaim_connections_get_handle(), "signed-on", 4833 gaim_signals_disconnect_by_handle(gtkblist);
4832 gtkblist, GAIM_CALLBACK(sign_on_off_cb));
4833 gaim_signal_disconnect(gaim_connections_get_handle(), "signed-off",
4834 gtkblist, GAIM_CALLBACK(sign_on_off_cb));
4835 4834
4836 gtk_widget_destroy(gtkblist->window); 4835 gtk_widget_destroy(gtkblist->window);
4837 4836
4838 gaim_gtk_blist_tooltip_destroy(); 4837 gaim_gtk_blist_tooltip_destroy();
4839 4838
4849 gtkblist->timeout = 0; 4848 gtkblist->timeout = 0;
4850 gtkblist->drag_timeout = 0; 4849 gtkblist->drag_timeout = 0;
4851 gtkblist->window = gtkblist->vbox = gtkblist->treeview = NULL; 4850 gtkblist->window = gtkblist->vbox = gtkblist->treeview = NULL;
4852 gtkblist->treemodel = NULL; 4851 gtkblist->treemodel = NULL;
4853 g_object_unref(G_OBJECT(gtkblist->ift)); 4852 g_object_unref(G_OBJECT(gtkblist->ift));
4854 g_free(gtkblist);
4855 accountmenu = NULL;
4856 gtkblist = NULL;
4857 4853
4858 gdk_cursor_unref(gtkblist->hand_cursor); 4854 gdk_cursor_unref(gtkblist->hand_cursor);
4859 gdk_cursor_unref(gtkblist->arrow_cursor); 4855 gdk_cursor_unref(gtkblist->arrow_cursor);
4860 gtkblist->hand_cursor = NULL; 4856 gtkblist->hand_cursor = NULL;
4861 gtkblist->arrow_cursor = NULL; 4857 gtkblist->arrow_cursor = NULL;
4862 4858
4859 g_free(gtkblist);
4860 accountmenu = NULL;
4861 gtkblist = NULL;
4863 gaim_prefs_disconnect_by_handle(gaim_gtk_blist_get_handle()); 4862 gaim_prefs_disconnect_by_handle(gaim_gtk_blist_get_handle());
4864 } 4863 }
4865 4864
4866 static void gaim_gtk_blist_set_visible(GaimBuddyList *list, gboolean show) 4865 static void gaim_gtk_blist_set_visible(GaimBuddyList *list, gboolean show)
4867 { 4866 {
5682 } 5681 }
5683 5682
5684 void 5683 void
5685 gaim_gtk_blist_uninit(void) { 5684 gaim_gtk_blist_uninit(void) {
5686 gaim_signals_unregister_by_instance(gaim_gtk_blist_get_handle()); 5685 gaim_signals_unregister_by_instance(gaim_gtk_blist_get_handle());
5686 gaim_signals_disconnect_by_handle(gaim_gtk_blist_get_handle());
5687 } 5687 }
5688 5688
5689 /********************************************************************* 5689 /*********************************************************************
5690 * Buddy List sorting functions * 5690 * Buddy List sorting functions *
5691 *********************************************************************/ 5691 *********************************************************************/