From 1cfd1e693a92b8289f77e7fe87261774d19e8048 Mon Sep 17 00:00:00 2001 From: brain Date: Thu, 20 Jul 2006 17:16:08 +0000 Subject: Someone please take a look at this and tell me why a thread doesnt free itself like it should when it exits, freeing the ram git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@4462 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/cmd_nick.cpp | 2 +- src/dns.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/cmd_nick.cpp b/src/cmd_nick.cpp index bfaddda23..4db2a53bb 100644 --- a/src/cmd_nick.cpp +++ b/src/cmd_nick.cpp @@ -153,7 +153,7 @@ void cmd_nick::Handle (const char** parameters, int pcnt, userrec *user) // initialize their dns lookup thread if (pthread_create(&user->dnsthread, NULL, dns_task, (void *)user) != 0) { - log(DEBUG,"Failed to create DNS lookup thread for user %s",user->nick); + log(DEBUG,"Failed to create DNS lookup thread for user %s: %s",user->nick, strerror(errno)); } #else user->dns_done = (!lookup_dns(user->nick)); diff --git a/src/dns.cpp b/src/dns.cpp index a6e413071..a8ed78cb6 100644 --- a/src/dns.cpp +++ b/src/dns.cpp @@ -917,7 +917,7 @@ void* dns_task(void* arg) } if ((fd_ref_table[thisfd] == u) && (fd_ref_table[thisfd])) u->dns_done = true; - return NULL; + pthread_exit(0); } #endif -- cgit v1.2.3