trap unexpected monitor reuse

This commit is contained in:
Michael Davidsaver
2016-09-03 19:23:00 -04:00
parent 4fb37eec9e
commit 8d187e4493

View File

@ -54,6 +54,14 @@ MonitorCacheEntry::monitorConnect(pvd::Status const & status,
interested_t::vector_type tonotify;
{
Guard G(mutex());
if(typedesc) {
// we shouldn't have to deal with monitor type change since we
// destroy() Monitors on Channel disconnect.
std::cerr<<"monitorConnect() w/ new type. Monitor has outlived it's connection.\n";
monitor->stop();
//TODO: unlisten()
return;
}
typedesc = structure;
if(status.isSuccess()) {