Skip to content

Commit 13920e5

Browse files
authored
[Linux] Fix crash when shutting down BLE Manager after platform shutdown (project-chip#36550)
1 parent 2439117 commit 13920e5

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/platform/Linux/bluez/BluezObjectManager.cpp

+5
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,11 @@ CHIP_ERROR BluezObjectManager::Init()
6262

6363
void BluezObjectManager::Shutdown()
6464
{
65+
// If the D-Bus connection or the object manager are not initialized,
66+
// there is nothing to shutdown. This check prevents unnecessary call
67+
// to the GLibMatterContextInvokeSync function.
68+
VerifyOrReturn(mConnection || mObjectManager);
69+
6570
// Run endpoint cleanup on the CHIPoBluez thread. This is necessary because the
6671
// cleanup function releases the D-Bus manager client object, which handles D-Bus
6772
// signals. Otherwise, we will face race condition when the D-Bus signal is in

0 commit comments

Comments
 (0)