diff libpurple/dnsquery.c @ 25843:9bdd3ab8087f

propagate from branch 'im.pidgin.pidgin' (head 4cc0bbe98be861a279e3b1fd97a3b4d491dec519) to branch 'im.pidgin.pidgin.next.minor' (head 0bc630b4c58beab06485f17e1633164d548ca68a)
author Richard Laager <rlaager@wiktel.com>
date Thu, 27 Nov 2008 06:57:15 +0000
parents 002a58d4af7d
children 1596d09393cf
line wrap: on
line diff
--- a/libpurple/dnsquery.c	Thu Nov 27 06:54:03 2008 +0000
+++ b/libpurple/dnsquery.c	Thu Nov 27 06:57:15 2008 +0000
@@ -345,6 +345,12 @@
 {
 	g_return_if_fail(resolver != NULL);
 
+	/* Keep this before the kill() call below. */
+	if (resolver->inpa != 0) {
+		purple_input_remove(resolver->inpa);
+		resolver->inpa = 0;
+	}
+
 	/*
 	 * We might as well attempt to kill our child process.  It really
 	 * doesn't matter if this fails, because children will expire on
@@ -353,9 +359,6 @@
 	if (resolver->dns_pid > 0)
 		kill(resolver->dns_pid, SIGKILL);
 
-	if (resolver->inpa != 0)
-		purple_input_remove(resolver->inpa);
-
 	close(resolver->fd_in);
 	close(resolver->fd_out);