diff --git a/src/cas/generic/casChannelI.cc b/src/cas/generic/casChannelI.cc index 92d5b08e9..0fe57b9ea 100644 --- a/src/cas/generic/casChannelI.cc +++ b/src/cas/generic/casChannelI.cc @@ -54,46 +54,46 @@ casChannelI::casChannelI (const casCtx &ctx) : // casChannelI::~casChannelI() { - this->lock(); - - // - // cancel any pending asynchronous IO - // - tsDLIterBD iterAIO(this->ioInProgList.first()); - while ( iterAIO!=tsDLIterBD::eol() ) { - // - // destructor removes from this list - // - tsDLIterBD tmpAIO = iterAIO; - ++tmpAIO; - iterAIO->serverDestroy(); - iterAIO = tmpAIO; - } - - // - // cancel the monitors - // - tsDLIterBD iterMon (this->monitorList.first()); - while ( iterMon!=tsDLIterBD::eol() ) { - casMonitor *pMonitor; - // - // destructor removes from this list - // + this->lock(); + + // + // cancel any pending asynchronous IO + // + tsDLIterBD iterAIO(this->ioInProgList.first()); + while ( iterAIO!=tsDLIterBD::eol() ) { + // + // destructor removes from this list + // + tsDLIterBD tmpAIO = iterAIO; + ++tmpAIO; + iterAIO->serverDestroy(); + iterAIO = tmpAIO; + } + + // + // cancel the monitors + // + tsDLIterBD iterMon (this->monitorList.first()); + while ( iterMon!=tsDLIterBD::eol() ) { + casMonitor *pMonitor; + // + // destructor removes from this list + // tsDLIterBD tmpMon = iterMon; - pMonitor = tmpMon; - ++tmpMon; - delete pMonitor; - iterMon = tmpMon; - } - - this->client.removeChannel(*this); - - // - // force PV delete if this is the last channel attached - // - this->pv.deleteSignal(); - - this->unlock(); + pMonitor = tmpMon; + ++tmpMon; + delete pMonitor; + iterMon = tmpMon; + } + + this->client.removeChannel(*this); + + // + // force PV delete if this is the last channel attached + // + this->pv.deleteSignal(); + + this->unlock(); } //