summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--p2pvr/lib/localDevices.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/p2pvr/lib/localDevices.cpp b/p2pvr/lib/localDevices.cpp
index 330271a..5478301 100644
--- a/p2pvr/lib/localDevices.cpp
+++ b/p2pvr/lib/localDevices.cpp
@@ -105,10 +105,6 @@ LocalDevices::ReleaseTuner(const P2PVR::TunerPrx & tuner, const Ice::Current & i
auto openTuner = std::find_if(devices.begin(), devices.end(), [tuner](const Devices::value_type & ot) {
return ot.second && ot.second->tuner == tuner;
});
- auto id = tuner->ice_getIdentity();
- if (ice.adapter->find(id)) {
- ice.adapter->remove(id);
- }
if (openTuner == devices.end()) {
Logger()->messagebf(LOG_DEBUG, "%s: Not one of mine", __PRETTY_FUNCTION__);
return;
@@ -116,6 +112,10 @@ LocalDevices::ReleaseTuner(const P2PVR::TunerPrx & tuner, const Ice::Current & i
Logger()->messagebf(LOG_DEBUG, "%s: Locally owned deivce %s", __PRETTY_FUNCTION__, openTuner->first);
openTuner->second->clients -= 1;
if (openTuner->second->clients == 0) {
+ auto id = tuner->ice_getIdentity();
+ if (ice.adapter->find(id)) {
+ ice.adapter->remove(id);
+ }
openTuner->second.reset();
}
}