LivoxProto1:Device: Refcount num stimbuffs attached

This commit is contained in:
2025-10-25 23:03:00 -04:00
parent b576d41595
commit 9e83a99c9c
3 changed files with 3 additions and 1 deletions
+1 -1
View File
@@ -230,7 +230,7 @@ void DeviceManager::destroyDeviceReq(
std::shared_ptr<Device> device = getDevice(dev->discoveredDevice).
value_or(nullptr);
if (!device)
if (!device || device->nAttachedStimBuffs > 0)
{
callback.callbackFn(false);
return;
+1
View File
@@ -97,6 +97,7 @@ Device::Device(const std::string &deviceIdentifier,
deviceIdentifier, comms::DeviceType::Mid40,
// Initialize empty. IP will be set upon successful connection.
""),
nAttachedStimBuffs(0),
componentThread(componentThread),
handshakeTimeoutMs(handshakeTimeoutMs), retryDelayMs(retryDelayMs),
smoIp(smoIp), detectedSmoListeningIp(""), smoSubnetNbits(smoSubnetNbits),
+1
View File
@@ -140,6 +140,7 @@ public:
public:
comms::DiscoveredDevice discoveredDevice;
std::atomic<size_t> nAttachedStimBuffs;
// Configuration
std::shared_ptr<smo::ComponentThread> componentThread;