From c9707ea0f52a3c5d10723efa4bce78ee046d2bfd Mon Sep 17 00:00:00 2001 From: Antoine Gouby Date: Fri, 27 Oct 2023 15:52:54 +0200 Subject: [PATCH] Fix missing unsubscribe causing segv --- source/pza/core/client.cxx | 2 ++ source/pza/core/device.cxx | 1 + 2 files changed, 3 insertions(+) diff --git a/source/pza/core/client.cxx b/source/pza/core/client.cxx index 4095c79..1286c07 100644 --- a/source/pza/core/client.cxx +++ b/source/pza/core/client.cxx @@ -359,6 +359,8 @@ device::ptr client::create_device(const std::string &topic_str) return nullptr; } + _unsubscribe(topic_str + "/device/atts/identity"); + if (json::get_string(identify_msg->get_payload_str(), "identity", "family", family) == -1) { spdlog::error("Failed to get family from device"); return nullptr; diff --git a/source/pza/core/device.cxx b/source/pza/core/device.cxx index 0de2bf2..7e8422e 100644 --- a/source/pza/core/device.cxx +++ b/source/pza/core/device.cxx @@ -19,6 +19,7 @@ void device::reset() _manufacturer = ""; } + int device::_set_identity(const std::string &payload) { std::string family;