diff --git a/src/platform/Linux/PlatformManagerImpl.cpp b/src/platform/Linux/PlatformManagerImpl.cpp index e536ade9b094d7..8001ae6677d7de 100644 --- a/src/platform/Linux/PlatformManagerImpl.cpp +++ b/src/platform/Linux/PlatformManagerImpl.cpp @@ -266,8 +266,8 @@ void PlatformManagerImpl::_Shutdown() #if CHIP_DEVICE_CONFIG_WITH_GLIB_MAIN_LOOP g_main_loop_quit(mGLibMainLoop); - g_main_loop_unref(mGLibMainLoop); g_thread_join(mGLibMainLoopThread); + g_main_loop_unref(mGLibMainLoop); #endif }