summaryrefslogtreecommitdiffstats
path: root/src/plugins/opcua/open62541/qopen62541backend.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/opcua/open62541/qopen62541backend.cpp')
-rw-r--r--src/plugins/opcua/open62541/qopen62541backend.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/plugins/opcua/open62541/qopen62541backend.cpp b/src/plugins/opcua/open62541/qopen62541backend.cpp
index ec0eb09..9fcd8d3 100644
--- a/src/plugins/opcua/open62541/qopen62541backend.cpp
+++ b/src/plugins/opcua/open62541/qopen62541backend.cpp
@@ -437,6 +437,8 @@ void Open62541AsyncBackend::connectToEndpoint(const QUrl &url)
if (m_uaclient)
UA_Client_delete(m_uaclient);
+ m_useStateCallback = false;
+
UA_ClientConfig conf = UA_ClientConfig_default;
conf.clientContext = this;
conf.stateCallback = &clientStateCallback;
@@ -469,6 +471,8 @@ void Open62541AsyncBackend::disconnectFromEndpoint()
m_subscriptions.clear();
m_attributeMapping.clear();
+ m_useStateCallback = false;
+
if (m_uaclient) {
UA_StatusCode ret = UA_Client_disconnect(m_uaclient);
if (ret != UA_STATUSCODE_GOOD) {