Improve UPNP callback removal (#3310)

Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk>
This commit is contained in:
Jacob Laursen 2023-01-14 11:30:06 +01:00 committed by GitHub
parent ecbb854e03
commit dd584779db
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -269,11 +269,10 @@ public class UpnpIOServiceImpl implements UpnpIOService, RegistryListener {
logger.trace("Removing an UPNP service subscription '{}' for particpant '{}'", serviceID, logger.trace("Removing an UPNP service subscription '{}' for particpant '{}'", serviceID,
participant.getUDN()); participant.getUDN());
UpnpSubscriptionCallback callback = subscriptionCallbacks.get(subService); UpnpSubscriptionCallback callback = subscriptionCallbacks.remove(subService);
if (callback != null) { if (callback != null) {
callback.end(); callback.end();
} }
subscriptionCallbacks.remove(subService);
} else { } else {
logger.trace("Could not find service '{}' for device '{}'", serviceID, logger.trace("Could not find service '{}' for device '{}'", serviceID,
device.getIdentity().getUdn()); device.getIdentity().getUdn());