Browse Source

CapabilityInquiryDemo: Fix shadowing warnings

v7.0.12
reuk 1 year ago
parent
commit
6c32c4df87
No known key found for this signature in database GPG Key ID: FCB43929F012EE5C
1 changed files with 9 additions and 6 deletions
  1. +9
    -6
      examples/Audio/CapabilityInquiryDemo.h

+ 9
- 6
examples/Audio/CapabilityInquiryDemo.h View File

@@ -3878,19 +3878,22 @@ private:
// If we're already subscribed, end that subscription. // If we're already subscribed, end that subscription.
// Otherwise, begin a new subscription to this resource. // Otherwise, begin a new subscription to this resource.
const auto changedToken = [this, propName = propName, muid = muid, existingToken = existingToken]() -> std::optional<ci::SubscriptionKey>
const auto changedToken = [this,
propNameCopy = propName,
muidCopy = muid,
existingTokenCopy = existingToken]() -> std::optional<ci::SubscriptionKey>
{ {
// We're not subscribed, so begin a new subscription // We're not subscribed, so begin a new subscription
if (! existingToken.has_value())
if (! existingTokenCopy.has_value())
{ {
ci::PropertySubscriptionHeader header; ci::PropertySubscriptionHeader header;
header.resource = propName;
header.resource = propNameCopy;
header.command = ci::PropertySubscriptionCommand::start; header.command = ci::PropertySubscriptionCommand::start;
return device->beginSubscription (muid, header);
return device->beginSubscription (muidCopy, header);
} }
device->endSubscription (*existingToken);
return existingToken;
device->endSubscription (*existingTokenCopy);
return existingTokenCopy;
}(); }();
if (changedToken.has_value()) if (changedToken.has_value())


Loading…
Cancel
Save