summaryrefslogtreecommitdiff
path: root/recording.c
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2005-12-18 13:38:30 +0100
committerKlaus Schmidinger <vdr@tvdr.de>2005-12-18 13:38:30 +0100
commit60d56fceb9c1e05f314a0a4c05e47a663fb8c1af (patch)
tree6e937b1d25306fd848d7db2aa91aca68a218f32e /recording.c
parent587ea30ab496fa594ac5172d519c29f48d4becb5 (diff)
downloadvdr-60d56fceb9c1e05f314a0a4c05e47a663fb8c1af.tar.gz
vdr-60d56fceb9c1e05f314a0a4c05e47a663fb8c1af.tar.bz2
Fixed a crash in removing recordings
Diffstat (limited to 'recording.c')
-rw-r--r--recording.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/recording.c b/recording.c
index 5cf769f4..3ab83ecf 100644
--- a/recording.c
+++ b/recording.c
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: recording.c 1.128 2005/12/18 13:09:47 kls Exp $
+ * $Id: recording.c 1.129 2005/12/18 13:38:30 kls Exp $
*/
#include "recording.h"
@@ -67,16 +67,20 @@ void RemoveDeletedRecordings(void)
static time_t LastRemoveCheck = 0;
if (time(NULL) - LastRemoveCheck > REMOVECHECKDELTA) {
cThreadLock DeletedRecordingsLock(&DeletedRecordings);
- for (cRecording *r = DeletedRecordings.First(); r; r = DeletedRecordings.Next(r)) {
+ for (cRecording *r = DeletedRecordings.First(); r; ) {
if (r->deleted && time(NULL) - r->deleted > DELETEDLIFETIME) {
// Make sure only one instance of VDR does this:
cLockFile LockFile(VideoDirectory);
if (LockFile.Lock()) {
+ cRecording *next = DeletedRecordings.Next(r);
r->Remove();
DeletedRecordings.Del(r);
+ r = next;
RemoveEmptyVideoDirectories();
+ continue;
}
}
+ r = DeletedRecordings.Next(r);
}
LastRemoveCheck = time(NULL);
}