mirror of
https://github.com/obsproject/obs-studio.git
synced 2025-12-28 07:55:01 +00:00
frontend: Use Qt parent-child ownership in OAuth dialog
By explicitly setting the OAuth dialog as the parent of the CEF widget, it will automatically by cleaned up as soon as the dialog is closed itself. This also detaches the destruction of the widget from the browser cleanup code.
This commit is contained in:
parent
0b12296320
commit
13ba51a9ad
@ -31,7 +31,7 @@ OAuthLogin::OAuthLogin(QWidget *parent, const std::string &url, bool token) : QD
|
||||
|
||||
OBSBasic::InitBrowserPanelSafeBlock();
|
||||
|
||||
cefWidget = cef->create_widget(nullptr, url, panel_cookies);
|
||||
cefWidget = cef->create_widget(this, url, panel_cookies);
|
||||
if (!cefWidget) {
|
||||
fail = true;
|
||||
return;
|
||||
@ -71,7 +71,9 @@ int OAuthLogin::exec()
|
||||
void OAuthLogin::reject()
|
||||
{
|
||||
#ifdef BROWSER_AVAILABLE
|
||||
delete cefWidget;
|
||||
if (cefWidget) {
|
||||
cefWidget->closeBrowser();
|
||||
}
|
||||
#endif
|
||||
QDialog::reject();
|
||||
}
|
||||
@ -79,7 +81,9 @@ void OAuthLogin::reject()
|
||||
void OAuthLogin::accept()
|
||||
{
|
||||
#ifdef BROWSER_AVAILABLE
|
||||
delete cefWidget;
|
||||
if (cefWidget) {
|
||||
cefWidget->closeBrowser();
|
||||
}
|
||||
#endif
|
||||
QDialog::accept();
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user