Skip to content

Commit

Permalink
fix: shutdown of server initialized classes in reverse order of initi…
Browse files Browse the repository at this point in the history
…alization (#19080)
  • Loading branch information
rochaferraz authored and pull[bot] committed Oct 16, 2023
1 parent cdf324b commit 4bbdb3c
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/app/server/Server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -345,21 +345,24 @@ void Server::ScheduleFactoryReset()

void Server::Shutdown()
{
mCASESessionManager.Shutdown();
app::DnssdServer::Instance().SetCommissioningModeProvider(nullptr);
chip::Dnssd::ServiceAdvertiser::Instance().Shutdown();

chip::Dnssd::Resolver::Instance().Shutdown();
chip::app::InteractionModelEngine::GetInstance()->Shutdown();
mMessageCounterManager.Shutdown();
CHIP_ERROR err = mExchangeMgr.Shutdown();
if (err != CHIP_NO_ERROR)
{
ChipLogError(AppServer, "Exchange Mgr shutdown: %" CHIP_ERROR_FORMAT, err.Format());
}
mSessions.Shutdown();
mTransports.Close();

mAccessControl.Finish();
Credentials::SetGroupDataProvider(nullptr);
mAttributePersister.Shutdown();
mCommissioningWindowManager.Shutdown();
mCASESessionManager.Shutdown();

// TODO(16969): Remove chip::Platform::MemoryInit() call from Server class, it belongs to outer code
chip::Platform::MemoryShutdown();
}
Expand Down

0 comments on commit 4bbdb3c

Please sign in to comment.