obs-browser: Fix browser panel crash
Before, we were calling DestroyWindow on the browser panel HWND from the CEF UI thread, which meant that the main program thread had to process window messages in order for that message to successfully through as DestroyWindow blocks on the WM_DESTROY/WM_NCDESTROY window messages. Unfortunately, this also had the side-effect of processing all queued Qt events, which, when called in the destructor of a window like this, can result in undefined behavior; specifically crashes, which were occurring due to this. Especially when browser panels were in docks and docked to the main window. So, instead of calling DestroyWindow in another thread and then processing events in the main thread, call DestroyWindow directly in the main thread to get WM_DESTROY/WM_NCDESTROY and only those processed on the spot. This appears to fix the crashes due to the undefined behavior when closing browser panels.
This commit is contained in: