Skip to content
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
Original file line number Diff line number Diff line change
Expand Up @@ -107,17 +107,21 @@ internal class WindowsTrayManager(
tray.set(newTray)
initialized.set(true)

// Signal that initialization is complete
// Signal that initialization is complete before entering the loop
initLatch.countDown()

// Run the blocking message loop on this thread
runMessageLoop()

} catch (e: Exception) {
} catch (e: Throwable) {
log("Error in tray thread: ${e.message}")
e.printStackTrace()
initLatch.countDown() // Ensure latch is released even on error
} finally {
// Safety net: release latch in case an Error prevented the
// countDown above from being reached. CountDownLatch.countDown()
// is a no-op when the count is already 0, so calling it twice
// on the success path is harmless.
initLatch.countDown()
cleanupTray()
}
}.apply {
Expand Down
2 changes: 1 addition & 1 deletion winlib
Submodule winlib updated 2 files
+2 −9 CMakeLists.txt
+19 −73 tray_windows.c
Loading