@@ -198,8 +198,6 @@ void InteractionModelEngine::Shutdown()
198
198
199
199
mTimedHandlers .ReleaseAll ();
200
200
201
- mReadHandlers .ReleaseAll ();
202
-
203
201
#if CHIP_CONFIG_ENABLE_READ_CLIENT
204
202
// Shut down any subscription clients that are still around. They won't be
205
203
// able to work after this point anyway, since we're about to drop our refs
@@ -220,6 +218,7 @@ void InteractionModelEngine::Shutdown()
220
218
readClient->mpImEngine = nullptr ;
221
219
auto * tmpClient = readClient->GetNextClient ();
222
220
readClient->SetNextClient (nullptr );
221
+ readClient->Close (CHIP_NO_ERROR);
223
222
readClient = tmpClient;
224
223
}
225
224
@@ -229,6 +228,7 @@ void InteractionModelEngine::Shutdown()
229
228
mpActiveReadClientList = nullptr ;
230
229
#endif // CHIP_CONFIG_ENABLE_READ_CLIENT
231
230
231
+ mReadHandlers .ReleaseAll ();
232
232
for (auto & writeHandler : mWriteHandlers )
233
233
{
234
234
if (!writeHandler.IsFree ())
@@ -1865,14 +1865,17 @@ Protocols::InteractionModel::Status InteractionModelEngine::CheckCommandExistenc
1865
1865
1866
1866
DataModel::Provider * InteractionModelEngine::SetDataModelProvider (DataModel::Provider * model)
1867
1867
{
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);
1871
1869
if (model == mDataModelProvider )
1872
1870
{
1873
1871
// no-op, just return
1874
1872
return model;
1875
1873
}
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 ());
1876
1879
1877
1880
DataModel::Provider * oldModel = mDataModelProvider ;
1878
1881
if (oldModel != nullptr )
0 commit comments