libpurple/protocols/bonjour/jabber.c

changeset 17632
b27a15168d33
parent 17607
4d7a1c0f169b
child 17633
b76241c02857
--- a/libpurple/protocols/bonjour/jabber.c	Wed Jun 06 03:21:04 2007 +0000
+++ b/libpurple/protocols/bonjour/jabber.c	Wed Jun 06 03:22:06 2007 +0000
@@ -668,8 +668,10 @@
 	GSList *l;
 
 	/* Close the server socket and remove all the watcher */
-	close(data->socket);
-	purple_input_remove(data->watcher_id);
+	if (data->socket >= 0)
+		close(data->socket);
+	if (data->watcher_id > 0)
+		purple_input_remove(data->watcher_id);
 
 	/* Close all the sockets and remove all the watchers after sending end streams */
 	if (data->account->gc != NULL)

mercurial