summaryrefslogtreecommitdiff
path: root/src/cmd_nick.cpp
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-07-20 18:02:09 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-07-20 18:02:09 +0000
commit6bfae0cd735052b91151f8ffc56808d090683483 (patch)
treeb89b421bd263613c9c63e7d9dbf5671f703be591 /src/cmd_nick.cpp
parent3a7023f2c595d14778b3f1f7e53d3914698dd500 (diff)
Fixed, no longer a memory leak (Thread leak)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@4465 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/cmd_nick.cpp')
-rw-r--r--src/cmd_nick.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/cmd_nick.cpp b/src/cmd_nick.cpp
index 4db2a53bb..17dfa626e 100644
--- a/src/cmd_nick.cpp
+++ b/src/cmd_nick.cpp
@@ -151,7 +151,10 @@ void cmd_nick::Handle (const char** parameters, int pcnt, userrec *user)
{
#ifdef THREADED_DNS
// initialize their dns lookup thread
- if (pthread_create(&user->dnsthread, NULL, dns_task, (void *)user) != 0)
+ pthread_attr_t attribs;
+ pthread_attr_init(&attribs);
+ pthread_attr_setdetachstate(&attribs, PTHREAD_CREATE_DETACHED);
+ if (pthread_create(&user->dnsthread, &attribs, dns_task, (void *)user) != 0)
{
log(DEBUG,"Failed to create DNS lookup thread for user %s: %s",user->nick, strerror(errno));
}