Skip to content

Commit

Permalink
Make sure DeviceController can be Setup after Shutdown and use the ex…
Browse files Browse the repository at this point in the history
…pected FabricTable (#18337)
  • Loading branch information
chrisdecenzo authored and pull[bot] committed Jan 15, 2024
1 parent a76f128 commit 3d4649a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/controller/CHIPDeviceControllerFactory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ CHIP_ERROR DeviceControllerFactory::InitSystemState()
params.fabricIndependentStorage = mFabricIndependentStorage;
params.enableServerInteractions = mEnableServerInteractions;
params.groupDataProvider = mSystemState->GetGroupDataProvider();
params.fabricTable = mSystemState->Fabrics();
}

return InitSystemState(params);
Expand Down Expand Up @@ -414,6 +415,10 @@ CHIP_ERROR DeviceControllerSystemState::Shutdown()
{
chip::Platform::Delete(mTempFabricTable);
mTempFabricTable = nullptr;
// if we created a temp fabric table, then mFabrics points to it.
// if we did not create a temp fabric table, then keep the reference
// so that SetupController/Commissioner can use it
mFabrics = nullptr;
}

return CHIP_NO_ERROR;
Expand Down

0 comments on commit 3d4649a

Please sign in to comment.