LivoxProto1:Device: Refcount num stimbuffs attached
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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),
|
||||
|
||||
@@ -140,6 +140,7 @@ public:
|
||||
|
||||
public:
|
||||
comms::DiscoveredDevice discoveredDevice;
|
||||
std::atomic<size_t> nAttachedStimBuffs;
|
||||
|
||||
// Configuration
|
||||
std::shared_ptr<smo::ComponentThread> componentThread;
|
||||
|
||||
Reference in New Issue
Block a user