On Mac, the behavior of the browser plugin has change in version 5.7 and is causing a crash in our existing code. We are using the Web Browser plugin for authentication with the following workflow (pseudo code below) : An IWebBrowserWindow is created, where the user can log in. Once it succeeds, the browser is forwarded to a new page that has the access code. We use IWebBrowserWindow->OnUrlChanged() to retrieve this code and then close the window using FSlateApplicationBase::Get().RequestDestroyWindow.
Starting 5.7 on Mac, destroying the window fails this check. It appears that on Windows the lambda provided to OnUrlChanged is called in GameThread, so there is no crash. On Mac, in version 5.6, this code is called in a thread named crBrowserMain, which also works. However in version 5.7 this is called in an unnamed thread and crashes.
Is this a bug or the expected behavior from now on?
auto window = SNew(SWindow).ClientSize(FVector2D(900, 700)).IsTopmostWindow(true);
FCreateBrowserWindowSettings windowSettings;
windowSettings.InitialURL = *AuthorizeURL;
auto webBrowserWindow = IWebBrowserModule::Get().GetSingleton()->CreateBrowserWindow(windowSettings);
webBrowserWindow->OnUrlChanged().AddLambda([this, window](FString NewUrl) {
// get access code
FSlateApplicationBase::Get().RequestDestroyWindow(window);
}
});
[Attachment Removed]