summaryrefslogtreecommitdiff
path: root/thread.c
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2004-03-14 16:51:13 +0100
committerKlaus Schmidinger <vdr@tvdr.de>2004-03-14 16:51:13 +0100
commit25154b62452926c5f558fc5f662168ddbdcd4422 (patch)
tree84d66817fbfac001cdedb6a0246c5c74acb3ed5e /thread.c
parentfaea9fed916712f0bc1bae0ba405d4d99ac4f401 (diff)
downloadvdr-25154b62452926c5f558fc5f662168ddbdcd4422.tar.gz
vdr-25154b62452926c5f558fc5f662168ddbdcd4422.tar.bz2
Fixed a memory leak in thread handling when using NPTL
Diffstat (limited to 'thread.c')
-rw-r--r--thread.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/thread.c b/thread.c
index 974362c9..084a4295 100644
--- a/thread.c
+++ b/thread.c
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: thread.c 1.30 2004/01/03 16:59:33 kls Exp $
+ * $Id: thread.c 1.31 2004/03/14 16:48:30 kls Exp $
*/
#include "thread.h"
@@ -199,6 +199,7 @@ bool cThread::Start(void)
running = true;
parentTid = pthread_self();
pthread_create(&childTid, NULL, (void *(*) (void *))&StartThread, (void *)this);
+ pthread_detach(childTid); // auto-reap
pthread_setschedparam(childTid, SCHED_RR, 0);
usleep(10000); // otherwise calling Active() immediately after Start() causes a "pure virtual method called" error
}