Skip to content

Commit 03f5e5d

Browse files
Trying to findout actual bug which causing CI failures.
1 parent 4f4e607 commit 03f5e5d

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

src/app/InteractionModelEngine.cpp

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -198,8 +198,6 @@ void InteractionModelEngine::Shutdown()
198198

199199
mTimedHandlers.ReleaseAll();
200200

201-
mReadHandlers.ReleaseAll();
202-
203201
#if CHIP_CONFIG_ENABLE_READ_CLIENT
204202
// Shut down any subscription clients that are still around. They won't be
205203
// able to work after this point anyway, since we're about to drop our refs
@@ -220,6 +218,7 @@ void InteractionModelEngine::Shutdown()
220218
readClient->mpImEngine = nullptr;
221219
auto * tmpClient = readClient->GetNextClient();
222220
readClient->SetNextClient(nullptr);
221+
readClient->Close(CHIP_NO_ERROR);
223222
readClient = tmpClient;
224223
}
225224

@@ -229,6 +228,7 @@ void InteractionModelEngine::Shutdown()
229228
mpActiveReadClientList = nullptr;
230229
#endif // CHIP_CONFIG_ENABLE_READ_CLIENT
231230

231+
mReadHandlers.ReleaseAll();
232232
for (auto & writeHandler : mWriteHandlers)
233233
{
234234
if (!writeHandler.IsFree())
@@ -1865,14 +1865,17 @@ Protocols::InteractionModel::Status InteractionModelEngine::CheckCommandExistenc
18651865

18661866
DataModel::Provider * InteractionModelEngine::SetDataModelProvider(DataModel::Provider * model)
18671867
{
1868-
// Altering data model should not be done while IM is actively handling requests.
1869-
VerifyOrDie(mReadHandlers.begin() == mReadHandlers.end());
1870-
1868+
printf("SetDataModelProvider called with data model provider: %p\n", model);
18711869
if (model == mDataModelProvider)
18721870
{
18731871
// no-op, just return
18741872
return model;
18751873
}
1874+
printf("mReadHandlers.begin(): %p and mReadHandlers.end(): %p\n", static_cast<void *>(*mReadHandlers.begin()),
1875+
static_cast<void *>(*mReadHandlers.end()));
1876+
1877+
// Altering data model should not be done while IM is actively handling requests.
1878+
VerifyOrDie(mReadHandlers.begin() == mReadHandlers.end());
18761879

18771880
DataModel::Provider * oldModel = mDataModelProvider;
18781881
if (oldModel != nullptr)

0 commit comments

Comments
 (0)