changeset 3607:851f421a0f8e

[gaim-migrate @ 3720] Yay Faceprint! He's the best! This will fix most prpl-autoload-related segfaults with the exception of signing off Jabber. Nathan's working for a fix on that right now. committer: Tailor Script <tailor@pidgin.im>
author Sean Egan <seanegan@gmail.com>
date Tue, 08 Oct 2002 22:54:38 +0000
parents 33643170bfde
children 7703b2689791
files src/server.c
diffstat 1 files changed, 7 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/server.c	Tue Oct 08 21:12:53 2002 +0000
+++ b/src/server.c	Tue Oct 08 22:54:38 2002 +0000
@@ -94,6 +94,11 @@
 	}
 }
 
+static gboolean delayed_unload(void *handle) {
+	g_module_close(handle);
+	return FALSE;
+}
+
 void serv_close(struct gaim_connection *gc)
 {
 	struct prpl *prpl;
@@ -123,7 +128,8 @@
 		debug_printf("Prpl %s is now being used by %d accounts\n", prpl->name, prpl_accounts[prpl->protocol]);
 		if (prpl_accounts[prpl->protocol] == 0) { /* We don't need this protocol anymore */
 			debug_printf("Throwing out prpl %s\n", prpl->name);
-			g_module_close(prpl->plug->handle);
+			unload_protocol(prpl);
+			g_timeout_add(0,delayed_unload, prpl->plug->handle);
 			prpl->plug->handle = NULL;
 		}
 	}