DolphinQt: Properly Delete (Some) Widgets

This is not every memory leak, just the ones that were obvious.
This commit is contained in:
mitaclaw
2024-04-30 10:58:16 -07:00
parent e69486d2cb
commit 0397339ab1
12 changed files with 25 additions and 9 deletions

View File

@ -295,19 +295,19 @@ void NetPlayBrowser::accept()
if (m_sessions[index].has_password)
{
auto* dialog = new QInputDialog(this);
QInputDialog dialog(this);
dialog->setWindowFlags(dialog->windowFlags() & ~Qt::WindowContextHelpButtonHint);
dialog->setWindowTitle(tr("Enter password"));
dialog->setLabelText(tr("This session requires a password:"));
dialog->setWindowModality(Qt::WindowModal);
dialog->setTextEchoMode(QLineEdit::Password);
dialog.setWindowFlags(dialog.windowFlags() & ~Qt::WindowContextHelpButtonHint);
dialog.setWindowTitle(tr("Enter password"));
dialog.setLabelText(tr("This session requires a password:"));
dialog.setWindowModality(Qt::WindowModal);
dialog.setTextEchoMode(QLineEdit::Password);
SetQWidgetWindowDecorations(dialog);
if (dialog->exec() != QDialog::Accepted)
SetQWidgetWindowDecorations(&dialog);
if (dialog.exec() != QDialog::Accepted)
return;
const std::string password = dialog->textValue().toStdString();
const std::string password = dialog.textValue().toStdString();
auto decrypted_id = session.DecryptID(password);