You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
panel: Update browser shutdown code to ensure proper sequence of events
When the underlying CEF browser instance is required to close (either
because the widget itself is being destroyed or because the associated
function was called explicitly) a specific sequence of events needs to
be ensured and also needs to block the thread it was called on.
This is necessary to ensure that CEF's own shutdown code can run to
completion before Qt continues with its own widget destruction and
cleanup code.
This change splits the procedure into 3 separate steps, each scheduled
to run in-order on the local event loop to simulate a "serial dispatch
queue":
1. Detach the window used by CEF from the Qt view hierarchy to prevent
CEF from closing the main OBS Studio window
2. Initiate the actual browser closure
3. Reset the Qt widget reference kept by the browser client and quit
the local event loop.
Step 3 is either executed after the "OnBeforeClose" lifetime event is
signaled by CEF or automatically after 1000 ms to limit the maximum of
time the UI is allowed to keep the user waiting.
0 commit comments