From 0d449c037b025247c6dcc46fa84778973dc5701e Mon Sep 17 00:00:00 2001 From: John Preston Date: Wed, 18 Aug 2021 13:08:46 +0300 Subject: [PATCH] Beta version 2.9.5: Fix hide workaround for media viewer. --- .../SourceFiles/media/view/media_view_overlay_widget.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Telegram/SourceFiles/media/view/media_view_overlay_widget.cpp b/Telegram/SourceFiles/media/view/media_view_overlay_widget.cpp index b81ca7d495..3832ff42f5 100644 --- a/Telegram/SourceFiles/media/view/media_view_overlay_widget.cpp +++ b/Telegram/SourceFiles/media/view/media_view_overlay_widget.cpp @@ -4518,9 +4518,10 @@ void OverlayWidget::applyHideWindowWorkaround() { _hideWorkaround->show(); _hideWorkaround->paintRequest( ) | rpl::start_with_next([=] { - QPainter(_hideWorkaround.get()).fillRect(_hideWorkaround->rect(), QColor(0, 1, 0, 1)); - crl::on_main(_hideWorkaround.get(), [=] { - _hideWorkaround.reset(); + const auto workaround = _hideWorkaround.release(); + QPainter(workaround).fillRect(workaround->rect(), QColor(0, 1, 0, 1)); + crl::on_main(workaround, [=] { + delete workaround; }); }, _hideWorkaround->lifetime()); _hideWorkaround->update();