[Fix] fix shutdown of handlers

This commit is contained in:
Robert von Burg 2022-10-07 16:06:15 +02:00
parent 15c9eb731d
commit 206c997f5a
Signed by: eitch
GPG Key ID: 75DB9C85C74331F7
2 changed files with 4 additions and 3 deletions

View File

@ -149,8 +149,6 @@ public class DefaultPlcHandler extends StrolchComponent implements PlcHandler, P
@Override
public void stop() throws Exception {
stopPlc();
if (this.ctx != null)
getContainer().getPrivilegeHandler().invalidate(this.ctx.getCertificate());
this.run = false;
if (this.messageSenderTask != null)
@ -158,6 +156,9 @@ public class DefaultPlcHandler extends StrolchComponent implements PlcHandler, P
if (this.updateStateTask != null)
this.updateStateTask.cancel(true);
if (this.ctx != null)
getContainer().getPrivilegeHandler().invalidate(this.ctx.getCertificate());
super.stop();
}

View File

@ -133,7 +133,7 @@ public class PlcGwClientHandler extends StrolchComponent implements GlobalPlcLis
this.run = false;
this.authenticated = false;
if (this.messageSenderTask != null)
this.messageSenderTask.cancel(false);
this.messageSenderTask.cancel(true);
notifyPlcConnectionState(ConnectionState.Disconnected);