summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2011-08-13 13:38:09 +0200
committerKlaus Schmidinger <vdr@tvdr.de>2011-08-13 13:38:09 +0200
commitff866ef82800b4f06bfd1c7b5e147c41f9928541 (patch)
treee16fd18f1fd4cbcc898b4fa1c5da9a2d8c0d232d
parentda8cde8615fde993b7ffd89fc615e8f954394c0f (diff)
downloadvdr-ff866ef82800b4f06bfd1c7b5e147c41f9928541.tar.gz
vdr-ff866ef82800b4f06bfd1c7b5e147c41f9928541.tar.bz2
Made DELETENULL() thread safe
-rw-r--r--CONTRIBUTORS1
-rw-r--r--HISTORY1
-rw-r--r--tools.h4
3 files changed, 4 insertions, 2 deletions
diff --git a/CONTRIBUTORS b/CONTRIBUTORS
index 0b4768ab..4764d5b3 100644
--- a/CONTRIBUTORS
+++ b/CONTRIBUTORS
@@ -1108,6 +1108,7 @@ Rolf Ahrenberg <rahrenbe@cc.hut.fi>
for adding handling of "ANSI/SCTE 57" descriptors
for some input on how to use BER and UNC values to generate a "quality" value
for fixing some crashes in subtitle display
+ for reporting that DELETENULL() was not thread safe
Ralf Klueber <ralf.klueber@vodafone.com>
for reporting a bug in cutting a recording if there is only a single editing mark
diff --git a/HISTORY b/HISTORY
index 93838331..e52e7841 100644
--- a/HISTORY
+++ b/HISTORY
@@ -6682,3 +6682,4 @@ Video Disk Recorder Revision History
- The length (as number of frames) of a recording's index file can now be determined
by a call to cIndexFile::GetLength() (suggested by Christoph Haubrich).
- Fixed some crashes in subtitle display (thanks to Rolf Ahrenberg).
+- Made DELETENULL() thread safe (reported by Rolf Ahrenberg).
diff --git a/tools.h b/tools.h
index c593c7f8..69b9613e 100644
--- a/tools.h
+++ b/tools.h
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: tools.h 2.8 2011/08/12 14:04:00 kls Exp $
+ * $Id: tools.h 2.9 2011/08/13 13:36:37 kls Exp $
*/
#ifndef __TOOLS_H
@@ -45,7 +45,7 @@ extern int SysLogLevel;
#define MALLOC(type, size) (type *)malloc(sizeof(type) * (size))
-#define DELETENULL(p) (delete (p), p = NULL)
+template<class T> inline void DELETENULL(T *&p) { T *q = p; p = NULL; delete q; }
#define CHECK(s) { if ((s) < 0) LOG_ERROR; } // used for 'ioctl()' calls
#define FATALERRNO (errno && errno != EAGAIN && errno != EINTR)