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

View File

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