libpurple/dnsquery.c

changeset 24701
777f269be1b0
parent 24390
24755e1e9f11
child 25360
4315bf325ab4
--- a/libpurple/dnsquery.c	Mon Nov 17 19:28:39 2008 +0000
+++ b/libpurple/dnsquery.c	Mon Nov 17 19:30:27 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);
 

mercurial