From adc008dee67d2028164edf3e04e6a13e1223783c Mon Sep 17 00:00:00 2001 From: mrkraimer Date: Tue, 17 May 2016 15:04:02 -0400 Subject: [PATCH] handle weak_pointer.lock() properly --- src/pvaClientChannel.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/pvaClientChannel.cpp b/src/pvaClientChannel.cpp index 542a466..d4730d3 100644 --- a/src/pvaClientChannel.cpp +++ b/src/pvaClientChannel.cpp @@ -233,8 +233,8 @@ void PvaClientChannel::channelStateChange( string PvaClientChannel::getRequesterName() { PvaClientPtr yyy = pvaClient.lock(); - if(!yyy) throw std::runtime_error( - "PvaClientChannel::getRequesterName() PvaClientChannel isDestroyed"); + if(!yyy) throw std::runtime_error( + "PvaClientChannel::getRequesterName() PvaClient isDestroyed"); return yyy->getRequesterName(); } @@ -243,8 +243,8 @@ void PvaClientChannel::message( MessageType messageType) { PvaClientPtr yyy = pvaClient.lock(); - if(isDestroyed) throw std::runtime_error( - "PvaClientChannel::message() pvaClientChannel isDestroyed"); + if(!yyy) throw std::runtime_error( + "PvaClientChannel::message() pvaClient isDestroyed"); yyy->message(channelName + " " + message, messageType); }