summaryrefslogtreecommitdiff
path: root/menu.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 /menu.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 'menu.c')
-rw-r--r--menu.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/menu.c b/menu.c
index 58c7763e..baa93173 100644
--- a/menu.c
+++ b/menu.c
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: menu.c 4.81 2020/04/11 09:22:05 kls Exp $
+ * $Id: menu.c 4.82 2020/05/18 16:47:29 kls Exp $
*/
#include "menu.h"
@@ -2731,7 +2731,8 @@ eOSState cMenuRecordingEdit::DeleteMarks(void)
if (buttonDeleteMarks && Interface->Confirm(tr("Delete editing marks for this recording?"))) {
if (cMarks::DeleteMarksFile(recording)) {
SetHelpKeys();
- if (cControl *Control = cControl::Control(true)) {
+ cMutexLock ControlMutexLock;
+ if (cControl *Control = cControl::Control(ControlMutexLock, true)) {
if (const cRecording *Recording = Control->GetRecording()) {
if (strcmp(recording->FileName(), Recording->FileName()) == 0)
Control->ClearEditingMarks();
@@ -4457,7 +4458,11 @@ bool cMenuMain::Update(bool Force)
{
bool result = false;
- bool NewReplaying = cControl::Control() != NULL;
+ bool NewReplaying = false;
+ {
+ cMutexLock ControlMutexLock;
+ NewReplaying = cControl::Control(ControlMutexLock) != NULL;
+ }
if (Force || NewReplaying != replaying) {
replaying = NewReplaying;
// Replay control: