From c02896ea17781d7f4411d93976d52216fe362e86 Mon Sep 17 00:00:00 2001 From: WarmUpTill <19472752+WarmUpTill@users.noreply.github.com> Date: Thu, 30 Apr 2026 15:55:31 +0200 Subject: [PATCH] Clear websocket and mqtt connections on shutdown This was previously implicitly done by a settings reload on shutdown, but this has since been removed, and we need to clear the connections explicitly. --- plugins/base/utils/connection-manager.cpp | 1 + plugins/mqtt/mqtt-helpers.cpp | 1 + 2 files changed, 2 insertions(+) diff --git a/plugins/base/utils/connection-manager.cpp b/plugins/base/utils/connection-manager.cpp index d9077106..c869eda2 100644 --- a/plugins/base/utils/connection-manager.cpp +++ b/plugins/base/utils/connection-manager.cpp @@ -23,6 +23,7 @@ bool setup() { AddSaveStep(saveConnections); AddLoadStep(loadConnections); + AddPluginCleanupStep([]() { connections.clear(); }); return true; } diff --git a/plugins/mqtt/mqtt-helpers.cpp b/plugins/mqtt/mqtt-helpers.cpp index bdb3ec2c..47b4d4cc 100644 --- a/plugins/mqtt/mqtt-helpers.cpp +++ b/plugins/mqtt/mqtt-helpers.cpp @@ -718,6 +718,7 @@ static bool setup() { AddSaveStep(SaveMqttConnections); AddLoadStep(LoadMqttConnections); + AddPluginCleanupStep([]() { GetMqttConnections().clear(); }); return true; }