Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix System vs Inet and BLE shutdown order #7429

Merged
merged 1 commit into from
Jun 8, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/controller/CHIPDeviceController.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -307,10 +307,10 @@ CHIP_ERROR DeviceController::Shutdown()
#if CONFIG_DEVICE_LAYER
ReturnErrorOnFailure(DeviceLayer::PlatformMgr().Shutdown());
#else
mSystemLayer->Shutdown();
mInetLayer->Shutdown();
chip::Platform::Delete(mSystemLayer);
mSystemLayer->Shutdown();
chip::Platform::Delete(mInetLayer);
chip::Platform::Delete(mSystemLayer);
#endif // CONFIG_DEVICE_LAYER

mSystemLayer = nullptr;
Expand Down
2 changes: 1 addition & 1 deletion src/controller/java/CHIPDeviceController-JNI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -229,8 +229,8 @@ void JNI_OnUnload(JavaVM * jvm, void * reserved)
sBleLayer.Shutdown();
#endif

sSystemLayer.Shutdown();
sInetLayer.Shutdown();
sSystemLayer.Shutdown();
sJVM = NULL;

chip::Platform::MemoryShutdown();
Expand Down
6 changes: 4 additions & 2 deletions src/include/platform/internal/GenericPlatformManagerImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -124,15 +124,17 @@ template <class ImplClass>
CHIP_ERROR GenericPlatformManagerImpl<ImplClass>::_Shutdown()
{
CHIP_ERROR err;
ChipLogError(DeviceLayer, "System Layer shutdown");
err = SystemLayer.Shutdown();
ChipLogError(DeviceLayer, "Inet Layer shutdown");
err = InetLayer.Shutdown();

#if CHIP_DEVICE_CONFIG_ENABLE_CHIPOBLE
ChipLogError(DeviceLayer, "BLE layer shutdown");
err = BLEMgr().GetBleLayer()->Shutdown();
#endif

ChipLogError(DeviceLayer, "System Layer shutdown");
err = SystemLayer.Shutdown();

return err;
}

Expand Down