From 43f468dc6881819ba7242125944f69cbbf7fa9ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Damian=20B=C3=BCchel?= Date: Thu, 13 Jan 2022 11:33:15 +0100 Subject: [PATCH] SEBWIN-539: Fixed bug where a missing service component would lead to termination of SEB during reconfiguration. This due to the fact that the connection lost event of the service was erroneously still registered for the reconfiguration procedure. --- SafeExamBrowser.Runtime/RuntimeController.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/SafeExamBrowser.Runtime/RuntimeController.cs b/SafeExamBrowser.Runtime/RuntimeController.cs index ecf95006..ba6140fc 100644 --- a/SafeExamBrowser.Runtime/RuntimeController.cs +++ b/SafeExamBrowser.Runtime/RuntimeController.cs @@ -228,6 +228,8 @@ namespace SafeExamBrowser.Runtime { if (SessionIsRunning) { + RegisterSessionEvents(); + runtimeWindow.ShowProgressBar = false; runtimeWindow.UpdateStatus(TextKey.RuntimeWindow_ApplicationRunning); runtimeWindow.TopMost = Session.Settings.Security.KioskMode != KioskMode.None; @@ -267,7 +269,6 @@ namespace SafeExamBrowser.Runtime runtimeHost.ClientConfigurationNeeded += RuntimeHost_ClientConfigurationNeeded; runtimeHost.ReconfigurationRequested += RuntimeHost_ReconfigurationRequested; runtimeHost.ShutdownRequested += RuntimeHost_ShutdownRequested; - service.ConnectionLost += ServiceProxy_ConnectionLost; } private void DeregisterEvents() @@ -275,17 +276,19 @@ namespace SafeExamBrowser.Runtime runtimeHost.ClientConfigurationNeeded -= RuntimeHost_ClientConfigurationNeeded; runtimeHost.ReconfigurationRequested -= RuntimeHost_ReconfigurationRequested; runtimeHost.ShutdownRequested -= RuntimeHost_ShutdownRequested; - service.ConnectionLost -= ServiceProxy_ConnectionLost; } private void RegisterSessionEvents() { + service.ConnectionLost += ServiceProxy_ConnectionLost; sessionContext.ClientProcess.Terminated += ClientProcess_Terminated; sessionContext.ClientProxy.ConnectionLost += ClientProxy_ConnectionLost; } private void DeregisterSessionEvents() { + service.ConnectionLost -= ServiceProxy_ConnectionLost; + if (sessionContext.ClientProcess != null) { sessionContext.ClientProcess.Terminated -= ClientProcess_Terminated;