diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2015-01-31 17:39:38 +0000 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2015-06-13 17:29:49 +0100 |
commit | 2d3ba1505c91cc1e3211e57fb4552d69dc04e3dc (patch) | |
tree | 4e5a94574d4e8690c627611a78d64efddf28b2fe | |
parent | Throw when setting up the proxy fails (diff) | |
download | p2pvr-2d3ba1505c91cc1e3211e57fb4552d69dc04e3dc.tar.bz2 p2pvr-2d3ba1505c91cc1e3211e57fb4552d69dc04e3dc.tar.xz p2pvr-2d3ba1505c91cc1e3211e57fb4552d69dc04e3dc.zip |
Add wrapper for removing the proxy early
-rw-r--r-- | p2pvr/lib/temporaryIceAdapterObject.h | 10 |
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; |