changeset 26691:ba99ee519926

Do not call the non-destroy prpl-ops when the connection is gone.
author Paul Aurich <paul@darkrain42.org>
date Wed, 15 Apr 2009 06:57:48 +0000
parents 9fb8d8d9783a
children 332d967670e0
files libpurple/disco.c
diffstat 1 files changed, 16 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/disco.c	Wed Apr 15 04:38:28 2009 +0000
+++ b/libpurple/disco.c	Wed Apr 15 06:57:48 2009 +0000
@@ -144,7 +144,9 @@
 		purple_disco_list_destroy(list);
 }
 
-void purple_disco_list_service_add(PurpleDiscoList *list, PurpleDiscoService *service, PurpleDiscoService *parent)
+void purple_disco_list_service_add(PurpleDiscoList *list,
+                                   PurpleDiscoService *service,
+                                   PurpleDiscoService *parent)
 {
 	g_return_if_fail(list != NULL);
 	g_return_if_fail(service != NULL);
@@ -194,8 +196,14 @@
 
 void purple_disco_cancel_get_list(PurpleDiscoList *list)
 {
+	PurpleConnection *pc;
+
 	g_return_if_fail(list != NULL);
 
+	pc = purple_account_get_connection(list->account);
+
+	g_return_if_fail(pc != NULL);
+
 	if (list->ops.cancel_cb)
 		list->ops.cancel_cb(list);
 
@@ -205,11 +213,16 @@
 void purple_disco_service_expand(PurpleDiscoService *service)
 {
 	PurpleDiscoList *list;
+	PurpleConnection *pc;
 
 	g_return_if_fail(service != NULL);
-	g_return_if_fail((service->flags & PURPLE_DISCO_BROWSE) == PURPLE_DISCO_BROWSE);
+	g_return_if_fail((service->flags & PURPLE_DISCO_BROWSE));
 
 	list = service->list;
+	pc = purple_account_get_connection(list->account);
+	
+	g_return_if_fail(pc != NULL);
+
 	purple_disco_list_set_in_progress(list, TRUE);
 
 	if (list->ops.expand_cb)
@@ -376,6 +389,7 @@
 void purple_disco_list_set_expand_func(PurpleDiscoList *list, PurpleDiscoServiceExpandFunc cb)
 {
 	g_return_if_fail(list != NULL);
+
 	list->ops.expand_cb = cb;
 }