From 0fc891340c459ff28ef2d2007b7450ca207bc567 Mon Sep 17 00:00:00 2001 From: Klaus Schmidinger Date: Fri, 14 Jan 2005 14:21:52 +0100 Subject: [PATCH] Fixed canceling the LIRC thread --- CONTRIBUTORS | 1 + HISTORY | 2 ++ lirc.c | 8 +++++--- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/CONTRIBUTORS b/CONTRIBUTORS index b8b55b45..65674af8 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -1107,6 +1107,7 @@ Marco Schl type errors" for some improvements to cPoller for implementing displaying mandatory subtitles in the SPU decoder + for pointing out a problem with canceling the LIRC thread Jürgen Schmitz for reporting a bug in displaying the current channel when switching via the SVDRP diff --git a/HISTORY b/HISTORY index 2e3ff1fd..61e6756a 100644 --- a/HISTORY +++ b/HISTORY @@ -3299,3 +3299,5 @@ Video Disk Recorder Revision History - Completed the Estonian OSD texts and switched to iso8859-13 character set (thanks to Arthur Konovalov). - Made cCondWait::SleepMs() sleep at least 3ms to avoid a possible busy wait. +- Fixed canceling the LIRC thread (thanks to Marco Schlüßler for pointing out + this one). diff --git a/lirc.c b/lirc.c index 8fe585ab..dbda75c2 100644 --- a/lirc.c +++ b/lirc.c @@ -6,7 +6,7 @@ * * LIRC support added by Carsten Koch 2000-06-16. * - * $Id: lirc.c 1.9 2004/12/19 18:05:13 kls Exp $ + * $Id: lirc.c 1.10 2005/01/14 14:18:42 kls Exp $ */ #include "lirc.h" @@ -40,9 +40,11 @@ cLircRemote::cLircRemote(char *DeviceName) cLircRemote::~cLircRemote() { + int fh = f; + f = -1; Cancel(); - if (f >= 0) - close(f); + if (fh >= 0) + close(fh); } bool cLircRemote::Ready(void)