From: Lars Op den Kamp Date: Fri, 13 Dec 2013 09:50:11 +0000 (+0100) Subject: don't crash on exit in cectray by preventing a new action from being started X-Git-Tag: upstream/2.2.0~1^2~3^2~12 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=b9e6e386dae199fe5bcd7cd203ada0e1c509f5c8;p=deb_libcec.git don't crash on exit in cectray by preventing a new action from being started --- diff --git a/src/LibCecTray/controller/Actions.cs b/src/LibCecTray/controller/Actions.cs index 13dc920..2970ede 100644 --- a/src/LibCecTray/controller/Actions.cs +++ b/src/LibCecTray/controller/Actions.cs @@ -94,7 +94,7 @@ namespace LibCECTray.controller _controller.CheckActiveDevices(); break; case UpdateEventType.ProcessCompleted: - if (!(_activeProcess is GetCurrentPhysicalAddress)) + if (!(_activeProcess is GetCurrentPhysicalAddress) && !SuppressUpdates) { _activeProcess = new GetCurrentPhysicalAddress(_controller.Lib); _activeProcess.EventHandler += ProcessEventHandler; @@ -123,6 +123,7 @@ namespace LibCECTray.controller break; case UpdateEventType.ExitApplication: + SuppressUpdates = true; _activeProcess = null; Application.Exit(); break; diff --git a/src/LibCecTray/ui/CECTray.cs b/src/LibCecTray/ui/CECTray.cs index ab04662..8df996e 100644 --- a/src/LibCecTray/ui/CECTray.cs +++ b/src/LibCecTray/ui/CECTray.cs @@ -79,6 +79,7 @@ namespace LibCECTray.ui public void OnSessionEnding(object sender, SessionEndingEventArgs e) { + Controller.CECActions.SuppressUpdates = true; Controller.Close(); } @@ -175,6 +176,7 @@ namespace LibCECTray.ui Hide(); if (disposing) { + Controller.CECActions.SuppressUpdates = true; Controller.Close(); } if (disposing && (components != null))