Commit 08981495 authored by Waqar Ahmed's avatar Waqar Ahmed
Browse files

Fix possible leak when commiting

parent 50be778a
......@@ -624,6 +624,7 @@ void GitWidget::opencommitChangesDialog()
GitCommitDialog *dialog = new GitCommitDialog(m_commitMessage, font, this);
connect(dialog, &QDialog::finished, this, [this, dialog](int res) {
dialog->deleteLater();
if (res == QDialog::Accepted) {
if (dialog->subject().isEmpty()) {
return sendMessage(i18n("Commit message cannot be empty."), true);
......@@ -631,7 +632,6 @@ void GitWidget::opencommitChangesDialog()
m_commitMessage = dialog->subject() + QStringLiteral("[[\n\n]]") + dialog->description();
commitChanges(dialog->subject(), dialog->description(), dialog->signoff());
}
dialog->deleteLater();
});
dialog->open();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment