Commit 47084fc
committed
Fix startup hang
The startup hang is due to the CEF's initialization in
BrowserManager::Impl::BrowserManagerEntry() taking much longer than it
used to take, so long that a browser source may try to be created in
BrowserManager::Impl::CreateBrowser before CEF is actually finished
initializing. When that happens and a browser source tried to be
created, the CefPostTask that's used in source creation would fail and
not properly post/execute the task, causing the browser source to
indefinitely hang while waiting for the task to finish, when in fact it
never executes at all.
To fix this issue, a manual reset startup event is used, which is
signaled when CEF finishes initialization. Then when trying to create
any browser source, it will wait to make sure that CEF startup event has
been signaled before attempting to post a task in to the Cef message
queue.
This has been a latent bug that had only been exposed recently, most
likely due to recent CEF changes that caused it to take longer than
normal to initialize.
Additionally, this bug most likely commonly happened once after system
startup due to caching of some sort.1 parent 2e5e679 commit 47084fc
File tree
2 files changed
+9
-3
lines changed- obs-browser
2 files changed
+9
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
107 | 107 | | |
108 | 108 | | |
109 | 109 | | |
| 110 | + | |
110 | 111 | | |
111 | 112 | | |
112 | 113 | | |
113 | 114 | | |
114 | 115 | | |
115 | | - | |
116 | 116 | | |
| 117 | + | |
| 118 | + | |
117 | 119 | | |
118 | 120 | | |
119 | 121 | | |
| |||
124 | 126 | | |
125 | 127 | | |
126 | 128 | | |
| 129 | + | |
| 130 | + | |
127 | 131 | | |
128 | 132 | | |
129 | 133 | | |
| |||
437 | 441 | | |
438 | 442 | | |
439 | 443 | | |
440 | | - | |
| 444 | + | |
441 | 445 | | |
442 | 446 | | |
443 | 447 | | |
| |||
449 | 453 | | |
450 | 454 | | |
451 | 455 | | |
| 456 | + | |
452 | 457 | | |
453 | 458 | | |
454 | 459 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
73 | 73 | | |
74 | 74 | | |
75 | 75 | | |
| 76 | + | |
76 | 77 | | |
77 | 78 | | |
78 | 79 | | |
79 | 80 | | |
80 | 81 | | |
81 | 82 | | |
82 | | - | |
| 83 | + | |
0 commit comments