From 3e5e0cb9df976aeffbe0224f4e0a149bc5f4e93a Mon Sep 17 00:00:00 2001 From: John Preston Date: Tue, 13 Apr 2021 19:02:17 +0400 Subject: [PATCH] Fix crash on right click in ConfirmBox with link. --- Telegram/SourceFiles/boxes/confirm_box.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/Telegram/SourceFiles/boxes/confirm_box.cpp b/Telegram/SourceFiles/boxes/confirm_box.cpp index 988e96370..90a72d84e 100644 --- a/Telegram/SourceFiles/boxes/confirm_box.cpp +++ b/Telegram/SourceFiles/boxes/confirm_box.cpp @@ -304,12 +304,10 @@ void ConfirmBox::mouseReleaseEvent(QMouseEvent *e) { _lastMousePos = e->globalPos(); updateHover(); if (const auto activated = ClickHandler::unpressed()) { - const auto guard = window(); - Ui::hideLayer(); - ActivateClickHandler(guard, activated, e->button()); - - // Keep the link alive, otherwise it is not activated. - crl::on_main([activated] {}); + ActivateClickHandler(window(), activated, e->button()); + crl::on_main(this, [=] { + closeBox(); + }); return; } BoxContent::mouseReleaseEvent(e);