From 0da0a5525963f5fad9a8196831fcb0f14a7d3d03 Mon Sep 17 00:00:00 2001 From: Mike Gelfand Date: Sat, 21 Jan 2023 18:56:38 +0300 Subject: [PATCH] Destroy message dialog on error (#3805 regression) (#4625) --- gtk/RelocateDialog.cc | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/gtk/RelocateDialog.cc b/gtk/RelocateDialog.cc index ece0210be..00fcec51f 100644 --- a/gtk/RelocateDialog.cc +++ b/gtk/RelocateDialog.cc @@ -99,17 +99,19 @@ bool RelocateDialog::Impl::onTimer() TR_GTK_BUTTONS_TYPE(CLOSE), true); - timer_.block(); d->signal_response().connect( [this, d](int /*response*/) mutable { - timer_.unblock(); d.reset(); + message_dialog_.reset(); + dialog_.close(); }); d->show(); + return false; } - else if (done_ == TR_LOC_DONE) + + if (done_ == TR_LOC_DONE) { if (!torrent_ids_.empty()) { @@ -117,11 +119,13 @@ bool RelocateDialog::Impl::onTimer() } else { + message_dialog_.reset(); dialog_.close(); + return false; } } - return G_SOURCE_CONTINUE; + return true; } void RelocateDialog::Impl::onResponse(int response)