diff --git a/src/app/ReadHandler.cpp b/src/app/ReadHandler.cpp index 4794ead97e..7861dcc1d5 100644 --- a/src/app/ReadHandler.cpp +++ b/src/app/ReadHandler.cpp @@ -55,8 +55,7 @@ uint16_t ReadHandler::GetPublisherSelectedIntervalLimit() ReadHandler::ReadHandler(ManagementCallback & apCallback, Messaging::ExchangeContext * apExchangeContext, InteractionType aInteractionType, Observer * observer, DataModel::Provider * apDataModel) : - mAttributePathExpandIterator(apDataModel, nullptr), - mExchangeCtx(*this), mManagementCallback(apCallback) + mAttributePathExpandIterator(apDataModel, nullptr), mExchangeCtx(*this), mManagementCallback(apCallback) { VerifyOrDie(apExchangeContext != nullptr); @@ -152,6 +151,7 @@ ReadHandler::~ReadHandler() auto * appCallback = mManagementCallback.GetAppCallback(); if (mFlags.Has(ReadHandlerFlags::ActiveSubscription) && appCallback) { + mFlags.Clear(ReadHandlerFlags::ActiveSubscription); appCallback->OnSubscriptionTerminated(*this); }