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).
|
std::shared_ptr<Device> device = getDevice(dev->discoveredDevice).
|
||||||
value_or(nullptr);
|
value_or(nullptr);
|
||||||
|
|
||||||
if (!device)
|
if (!device || device->nAttachedStimBuffs > 0)
|
||||||
{
|
{
|
||||||
callback.callbackFn(false);
|
callback.callbackFn(false);
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -97,6 +97,7 @@ Device::Device(const std::string &deviceIdentifier,
|
|||||||
deviceIdentifier, comms::DeviceType::Mid40,
|
deviceIdentifier, comms::DeviceType::Mid40,
|
||||||
// Initialize empty. IP will be set upon successful connection.
|
// Initialize empty. IP will be set upon successful connection.
|
||||||
""),
|
""),
|
||||||
|
nAttachedStimBuffs(0),
|
||||||
componentThread(componentThread),
|
componentThread(componentThread),
|
||||||
handshakeTimeoutMs(handshakeTimeoutMs), retryDelayMs(retryDelayMs),
|
handshakeTimeoutMs(handshakeTimeoutMs), retryDelayMs(retryDelayMs),
|
||||||
smoIp(smoIp), detectedSmoListeningIp(""), smoSubnetNbits(smoSubnetNbits),
|
smoIp(smoIp), detectedSmoListeningIp(""), smoSubnetNbits(smoSubnetNbits),
|
||||||
|
|||||||
@@ -140,6 +140,7 @@ public:
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
comms::DiscoveredDevice discoveredDevice;
|
comms::DiscoveredDevice discoveredDevice;
|
||||||
|
std::atomic<size_t> nAttachedStimBuffs;
|
||||||
|
|
||||||
// Configuration
|
// Configuration
|
||||||
std::shared_ptr<smo::ComponentThread> componentThread;
|
std::shared_ptr<smo::ComponentThread> componentThread;
|
||||||
|
|||||||
Reference in New Issue
Block a user