summaryrefslogtreecommitdiff
path: root/menu.c
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2018-03-18 12:03:46 +0100
committerKlaus Schmidinger <vdr@tvdr.de>2018-03-18 12:03:46 +0100
commita2b6b142d8cfbae4373449b3ad582cdc6c1f5cc0 (patch)
tree3573fb49d4be226e6b97064b7c194ecb05c99baf /menu.c
parent55408b73ca1f08d259ff540724dff5627577c9c1 (diff)
downloadvdr-a2b6b142d8cfbae4373449b3ad582cdc6c1f5cc0.tar.gz
vdr-a2b6b142d8cfbae4373449b3ad582cdc6c1f5cc0.tar.bz2
Modified cMenuTimers::Delete() to avoid a lengthy lock on the Timers list while prompting the user2.3.9
Diffstat (limited to 'menu.c')
-rw-r--r--menu.c38
1 files changed, 18 insertions, 20 deletions
diff --git a/menu.c b/menu.c
index e6c79d91..d5300153 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.68 2018/03/09 15:02:29 kls Exp $
+ * $Id: menu.c 4.69 2018/03/18 12:01:09 kls Exp $
*/
#include "menu.h"
@@ -1344,29 +1344,27 @@ eOSState cMenuTimers::Delete(void)
// Check if this timer is active:
cTimer *Timer = GetTimer();
if (Timer) {
- if (Interface->Confirm(tr("Delete timer?"))) {
- if (Timer->Recording()) {
- if (Interface->Confirm(tr("Timer still recording - really delete?"))) {
- if (!Timer->Remote()) {
- Timer->Skip();
- cRecordControls::Process(Timers, time(NULL));
- }
- }
- else
- Timer = NULL;
- }
+ bool TimerRecording = Timer->Recording();
+ timersStateKey.Remove(false); // must release lock while prompting!
+ if (Interface->Confirm(tr("Delete timer?")) && (!TimerRecording || Interface->Confirm(tr("Timer still recording - really delete?")))) {
+ Timers = cTimers::GetTimersWrite(timersStateKey);
+ Timer = GetTimer();
if (Timer) {
- if (!HandleRemoteModifications(NULL, Timer)) {
- timersStateKey.Remove();
- return osContinue;
+ if (!Timer->Remote()) {
+ Timer->Skip();
+ cRecordControls::Process(Timers, time(NULL));
+ }
+ if (HandleRemoteModifications(NULL, Timer)) {
+ if (Timer->Remote())
+ Timers->SetSyncStateKey(StateKeySVDRPRemoteTimersPoll);
+ Timers->Del(Timer);
+ cOsdMenu::Del(Current());
+ Display();
}
- if (Timer->Remote())
- Timers->SetSyncStateKey(StateKeySVDRPRemoteTimersPoll);
- Timers->Del(Timer);
- cOsdMenu::Del(Current());
- Display();
}
}
+ else
+ return osContinue;
}
timersStateKey.Remove(Timer != NULL);
return osContinue;