Skip to content

Commit ac34d8e

Browse files
tt2468RytoEX
authored andcommitted
Don't loop Cef exit while shutting down if task post fails
If the `manager_thread` exits early, there will be no message loop to post the task to, and a permanent deadlock would occur. Rather than guaranteeing a deadlock, this at least lowers the odds of one. A future implementation might be more aware of the run state of the manager thread and handle these exit scenarios more explicitly.
1 parent 46adc4b commit ac34d8e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

obs-browser-plugin.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -779,8 +779,8 @@ void obs_module_unload(void)
779779
BrowserShutdown();
780780
#else
781781
if (manager_thread.joinable()) {
782-
while (!QueueCEFTask([]() { CefQuitMessageLoop(); }))
783-
os_sleep_ms(5);
782+
if (!QueueCEFTask([]() { CefQuitMessageLoop(); }))
783+
blog(LOG_DEBUG, "[obs-browser]: Failed to post CefQuit task to loop");
784784

785785
manager_thread.join();
786786
}

0 commit comments

Comments
 (0)