From 25154b62452926c5f558fc5f662168ddbdcd4422 Mon Sep 17 00:00:00 2001 From: Klaus Schmidinger Date: Sun, 14 Mar 2004 16:51:13 +0100 Subject: [PATCH] Fixed a memory leak in thread handling when using NPTL --- CONTRIBUTORS | 1 + HISTORY | 4 ++++ config.h | 6 +++--- thread.c | 3 ++- 4 files changed, 10 insertions(+), 4 deletions(-) diff --git a/CONTRIBUTORS b/CONTRIBUTORS index 1f722319..fe90018b 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -797,6 +797,7 @@ Karim Afifi Jon Burgess for pointing out a problem with NPTL ("Native Posix Thread Library") for changing thread handling to make it work with NPTL ("Native Posix Thread Library") + for fixing a memory leak in thread handling when using NPTL Thomas Schmidt for reporting a crash when cancelling a newly created timer diff --git a/HISTORY b/HISTORY index 6bd77457..f6206187 100644 --- a/HISTORY +++ b/HISTORY @@ -2745,3 +2745,7 @@ Video Disk Recorder Revision History events to timers. - Now explicitly turning on the LNB power at startup, because newer drivers don't do this any more (thanks to Oliver Endriss for pointing this out). + +2004-03-14: Version 1.3.7 + +- Fixed a memory leak in thread handling when using NPTL (thanks to Jon Burgess). diff --git a/config.h b/config.h index d2afdeea..fdccd417 100644 --- a/config.h +++ b/config.h @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: config.h 1.190 2004/03/05 14:35:15 kls Exp $ + * $Id: config.h 1.191 2004/03/14 16:51:13 kls Exp $ */ #ifndef __CONFIG_H @@ -20,8 +20,8 @@ #include "i18n.h" #include "tools.h" -#define VDRVERSION "1.3.6" -#define VDRVERSNUM 10306 // Version * 10000 + Major * 100 + Minor +#define VDRVERSION "1.3.7" +#define VDRVERSNUM 10307 // Version * 10000 + Major * 100 + Minor #define MAXPRIORITY 99 #define MAXLIFETIME 99 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 }