From 2d3ba1505c91cc1e3211e57fb4552d69dc04e3dc Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Sat, 31 Jan 2015 17:39:38 +0000 Subject: Add wrapper for removing the proxy early --- p2pvr/lib/temporaryIceAdapterObject.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) 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; -- cgit v1.2.3