Skip to content

Commit

Permalink
Fix ExchangeContext leak in chip_im_initiator (Fix: project-chip#6915)
Browse files Browse the repository at this point in the history
  • Loading branch information
kghost committed May 18, 2021
1 parent 805a4b3 commit 84d8b1e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/messaging/ExchangeMgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@
#include <core/CHIPEncoding.h>
#include <messaging/ExchangeContext.h>
#include <messaging/ExchangeMgr.h>
#include <platform/CHIPDeviceLayer.h>
#include <platform/PlatformManager.h>
#include <protocols/Protocols.h>
#include <support/CHIPFaultInjection.h>
#include <support/CodeUtils.h>
Expand Down Expand Up @@ -94,6 +96,7 @@ CHIP_ERROR ExchangeManager::Init(SecureSessionMgr * sessionMgr)

CHIP_ERROR ExchangeManager::Shutdown()
{
DeviceLayer::PlatformMgr().LockChipStack();
mReliableMessageMgr.Shutdown();

mContextPool.ForEachActiveObject([](auto * ec) {
Expand All @@ -109,6 +112,7 @@ CHIP_ERROR ExchangeManager::Shutdown()
}

mState = State::kState_NotInitialized;
DeviceLayer::PlatformMgr().UnlockChipStack();

return CHIP_NO_ERROR;
}
Expand Down

0 comments on commit 84d8b1e

Please sign in to comment.