SharedPV allow use of Channel::destroy() to trigger onLastDisconnect()

Add dead flag to catch double destroy() or use after destroy()
This commit is contained in:
Michael Davidsaver
2018-10-07 20:00:38 -07:00
parent ed1bd1b962
commit 9ca7487e29
5 changed files with 140 additions and 69 deletions

View File

@@ -31,6 +31,8 @@ struct SharedChannel : public pva::Channel,
const requester_type::weak_pointer requester;
const pva::ChannelProvider::weak_pointer provider;
bool dead; // has destroy() been called?
SharedChannel(const std::tr1::shared_ptr<SharedPV>& owner,
const pva::ChannelProvider::shared_pointer provider,
const std::string& channelName,