diff options
author | Klaus Schmidinger <vdr@tvdr.de> | 2011-08-13 13:38:09 +0200 |
---|---|---|
committer | Klaus Schmidinger <vdr@tvdr.de> | 2011-08-13 13:38:09 +0200 |
commit | ff866ef82800b4f06bfd1c7b5e147c41f9928541 (patch) | |
tree | e16fd18f1fd4cbcc898b4fa1c5da9a2d8c0d232d /tools.h | |
parent | da8cde8615fde993b7ffd89fc615e8f954394c0f (diff) | |
download | vdr-ff866ef82800b4f06bfd1c7b5e147c41f9928541.tar.gz vdr-ff866ef82800b4f06bfd1c7b5e147c41f9928541.tar.bz2 |
Made DELETENULL() thread safe
Diffstat (limited to 'tools.h')
-rw-r--r-- | tools.h | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -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) |