diff options
Diffstat (limited to 'qpid/cpp')
-rw-r--r-- | qpid/cpp/include/qpid/client/SubscriptionManager.h | 4 | ||||
-rw-r--r-- | qpid/cpp/src/qpid/client/SubscriptionManagerImpl.cpp | 10 |
2 files changed, 12 insertions, 2 deletions
diff --git a/qpid/cpp/include/qpid/client/SubscriptionManager.h b/qpid/cpp/include/qpid/client/SubscriptionManager.h index b69819a8ff..404a9c6eb9 100644 --- a/qpid/cpp/include/qpid/client/SubscriptionManager.h +++ b/qpid/cpp/include/qpid/client/SubscriptionManager.h @@ -280,8 +280,8 @@ class QPID_CLIENT_CLASS_EXTERN SubscriptionManager : public sys::Runnable, publi /** AutoCancel cancels a subscription in its destructor */ class AutoCancel { public: - AutoCancel(SubscriptionManager& sm_, const std::string& tag_) : sm(sm_), tag(tag_) {} - ~AutoCancel() { sm.cancel(tag); } + AutoCancel(SubscriptionManager&, const std::string& tag); + ~AutoCancel(); private: SubscriptionManager& sm; std::string tag; diff --git a/qpid/cpp/src/qpid/client/SubscriptionManagerImpl.cpp b/qpid/cpp/src/qpid/client/SubscriptionManagerImpl.cpp index 7dead112e5..44f81776c0 100644 --- a/qpid/cpp/src/qpid/client/SubscriptionManagerImpl.cpp +++ b/qpid/cpp/src/qpid/client/SubscriptionManagerImpl.cpp @@ -28,6 +28,7 @@ #include <qpid/client/Session.h> #include <qpid/client/MessageListener.h> #include <qpid/framing/Uuid.h> +#include <qpid/log/Statement.h> #include <set> #include <sstream> @@ -167,6 +168,15 @@ void SubscriptionManagerImpl::setFlowControl(const std::string& name, uint32_t m setFlowControl(name, FlowControl(messages, bytes, window)); } +AutoCancel::AutoCancel(SubscriptionManager& sm_, const std::string& tag_) : sm(sm_), tag(tag_) {} +AutoCancel::~AutoCancel() { + try { + sm.cancel(tag); + } catch (const qpid::Exception& e) { + QPID_LOG(info, "Exception in AutoCancel destructor: " << e.what()); + } +} + }} // namespace qpid::client |