cpw.darkrain42.xmpp.disco: 0a29ca89: Do not call the non-destroy prpl-ops whe...

paul at darkrain42.org paul at darkrain42.org
Sat Apr 25 16:16:05 EDT 2009


-----------------------------------------------------------------
Revision: 0a29ca89a8dbe84c8b4d4631185db447391c375f
Ancestor: 4afae628241a3f1597c9b10df60ba9ab4f2beaeb
Author: paul at darkrain42.org
Date: 2009-04-15T06:57:48
Branch: im.pidgin.cpw.darkrain42.xmpp.disco
URL: http://d.pidgin.im/viewmtn/revision/info/0a29ca89a8dbe84c8b4d4631185db447391c375f

Modified files:
        libpurple/disco.c

ChangeLog: 

Do not call the non-destroy prpl-ops when the connection is gone.

-------------- next part --------------
============================================================
--- libpurple/disco.c	9a64944a368e3a2ea210ac44c361ab3e3fad8a9a
+++ libpurple/disco.c	d6d8374e5acdac1cf7a7d8941e5a06420ade7abf
@@ -144,7 +144,9 @@ void purple_disco_list_unref(PurpleDisco
 		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(Purple
 
 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(PurpleD
 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(P
 void purple_disco_list_set_expand_func(PurpleDiscoList *list, PurpleDiscoServiceExpandFunc cb)
 {
 	g_return_if_fail(list != NULL);
+
 	list->ops.expand_cb = cb;
 }
 


More information about the Commits mailing list