summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--p2pvr/lib/temporaryIceAdapterObject.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/p2pvr/lib/temporaryIceAdapterObject.h b/p2pvr/lib/temporaryIceAdapterObject.h
index e9ba317..411f7cf 100644
--- a/p2pvr/lib/temporaryIceAdapterObject.h
+++ b/p2pvr/lib/temporaryIceAdapterObject.h
@@ -18,7 +18,7 @@ class TemporaryIceAdapterObject {
~TemporaryIceAdapterObject()
{
- adapter->remove(proxy->ice_getIdentity());
+ remove();
}
TemporaryIceAdapterObject(const TemporaryIceAdapterObject &) = delete;
@@ -44,6 +44,14 @@ class TemporaryIceAdapterObject {
return pr == proxy;
}
+ void remove()
+ {
+ if (proxy) {
+ adapter->remove(proxy->ice_getIdentity());
+ proxy = NULL;
+ }
+ }
+
private:
Ice::ObjectAdapterPtr adapter;
Object * object;