summaryrefslogtreecommitdiff
path: root/player.c
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2020-05-18 16:47:29 +0200
committerKlaus Schmidinger <vdr@tvdr.de>2020-05-18 16:47:29 +0200
commit196785ff054a3236747ac8ad0302300c052d377a (patch)
tree12c4559386bc990b9e64804e80268f3387e5899d /player.c
parentdd9dd76722fac5902b9237d836bb1b7bce9bcbae (diff)
downloadvdr-196785ff054a3236747ac8ad0302300c052d377a.tar.gz
vdr-196785ff054a3236747ac8ad0302300c052d377a.tar.bz2
Fixed a possible crash in case replay is started and stopped in rapid sequence2.4.2
Diffstat (limited to 'player.c')
-rw-r--r--player.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/player.c b/player.c
index 5c95f4e4..ff54f495 100644
--- a/player.c
+++ b/player.c
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: player.c 2.2 2012/04/28 11:52:50 kls Exp $
+ * $Id: player.c 4.1 2020/05/18 16:47:29 kls Exp $
*/
#include "player.h"
@@ -70,16 +70,24 @@ cString cControl::GetHeader(void)
return "";
}
+#if DEPRECATED_CCONTROL
cControl *cControl::Control(bool Hidden)
{
cMutexLock MutexLock(&mutex);
return (control && (!control->hidden || Hidden)) ? control : NULL;
}
+#endif
+
+cControl *cControl::Control(cMutexLock &MutexLock, bool Hidden)
+{
+ MutexLock.Lock(&mutex);
+ return (control && (!control->hidden || Hidden)) ? control : NULL;
+}
void cControl::Launch(cControl *Control)
{
cMutexLock MutexLock(&mutex);
- cControl *c = control; // keeps control from pointing to uninitialized memory
+ cControl *c = control; // keeps control from pointing to uninitialized memory TODO obsolete once DEPRECATED_CCONTROL is gone
control = Control;
delete c;
}