diff --git a/src/db/dbContext.cpp b/src/db/dbContext.cpp index 44e25d406..307d86c3f 100644 --- a/src/db/dbContext.cpp +++ b/src/db/dbContext.cpp @@ -311,6 +311,8 @@ void dbContext::ioCancel ( dbSubscriptionIO *pSIO = pIO->isSubscription (); if ( pSIO ) { chan.dbContextPrivateListOfIO::eventq.remove ( *pSIO ); + pSIO->unsubscribe ( guard ); + pSIO->channelDeleteException ( guard ); pSIO->destructor ( guard ); this->dbSubscriptionIOFreeList.release ( pSIO ); } diff --git a/src/db/dbSubscriptionIO.cpp b/src/db/dbSubscriptionIO.cpp index 79c81ce7c..038bda1ea 100644 --- a/src/db/dbSubscriptionIO.cpp +++ b/src/db/dbSubscriptionIO.cpp @@ -69,7 +69,6 @@ dbSubscriptionIO::~dbSubscriptionIO () void dbSubscriptionIO::destructor ( epicsGuard < epicsMutex > & guard ) { guard.assertIdenticalMutex ( this->mutex ); - this->unsubscribe ( guard ); this->~dbSubscriptionIO (); }