summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2015-01-31 17:39:38 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2015-06-13 17:29:49 +0100
commit2d3ba1505c91cc1e3211e57fb4552d69dc04e3dc (patch)
tree4e5a94574d4e8690c627611a78d64efddf28b2fe
parentThrow when setting up the proxy fails (diff)
downloadp2pvr-2d3ba1505c91cc1e3211e57fb4552d69dc04e3dc.tar.bz2
p2pvr-2d3ba1505c91cc1e3211e57fb4552d69dc04e3dc.tar.xz
p2pvr-2d3ba1505c91cc1e3211e57fb4552d69dc04e3dc.zip
Add wrapper for removing the proxy early
-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;