diff --git a/src/platform/Tizen/PlatformManagerImpl.cpp b/src/platform/Tizen/PlatformManagerImpl.cpp index 9f55f3b824f3de..27174a6c4c74ee 100644 --- a/src/platform/Tizen/PlatformManagerImpl.cpp +++ b/src/platform/Tizen/PlatformManagerImpl.cpp @@ -129,11 +129,19 @@ CHIP_ERROR PlatformManagerImpl::_InitChipStack() void PlatformManagerImpl::_Shutdown() { + if (mGLibMainLoop == nullptr) + { + ChipLogError(DeviceLayer, "System Layer is already shutdown."); + return; + } + Internal::GenericPlatformManagerImpl_POSIX::_Shutdown(); g_main_loop_quit(mGLibMainLoop); g_main_loop_unref(mGLibMainLoop); g_thread_join(mGLibMainLoopThread); + + mGLibMainLoop = nullptr; } CHIP_ERROR PlatformManagerImpl::_GLibMatterContextInvokeSync(CHIP_ERROR (*func)(void *), void * userData)