Matter (formerly Project CHIP) creates more connections between more objects, simplifying development for manufacturers and increasing compatibility for consumers, guided by the Connectivity Standards Alliance.
The InteractionModelEngine is not cleanly clearing up mpFabricTable and mpExchangeMgr today on Shutdown. Doing so invites a world of problems in the SDK:
ReadClient continues to depend on those members being non-null in its destruction due to its call into in the IM engine in ReadClient::CancelLivenessCheckTimer. This is not a problem in and of itself, but it does alter the paradigm that ReadClient instances can continue to exist well-past IM engine shutdown, which is implied here in InteractionModelEngine::Shutdown:
//
// We hold weak references to ReadClient objects. The application ultimately
// actually owns them, so it's on them to eventually shut them down and free them
// up.
//
// However, we should null out their pointers back to us at the very least so that
// at destruction time, they won't attempt to reach back here to remove themselves
// from this list.
//
We need to fix this, and consequently, fix the various tests that depend on this premise.
Lots of test (TestReadInteraction and TestWriteInteraction) manually Init and Shutdown the engine repeatedly in their tests. At the end of the test, the AppContext does a second Shutdown of the engine as well, which causes problems since Shutdown today is not meant to be called multiple times.
Problem
The InteractionModelEngine is not cleanly clearing up
mpFabricTable
andmpExchangeMgr
today onShutdown
. Doing so invites a world of problems in the SDK:ReadClient
continues to depend on those members being non-null in its destruction due to its call into in the IM engine inReadClient::CancelLivenessCheckTimer
. This is not a problem in and of itself, but it does alter the paradigm thatReadClient
instances can continue to exist well-past IM engine shutdown, which is implied here inInteractionModelEngine::Shutdown
:We need to fix this, and consequently, fix the various tests that depend on this premise.
TestReadInteraction
andTestWriteInteraction
) manually Init and Shutdown the engine repeatedly in their tests. At the end of the test, theAppContext
does a second Shutdown of the engine as well, which causes problems since Shutdown today is not meant to be called multiple times.