From 667e614bf3ae360a8f5281862341469b0382692a Mon Sep 17 00:00:00 2001 From: 23rd <23rd@vivaldi.net> Date: Sat, 12 Apr 2025 19:32:44 +0300 Subject: [PATCH] Simplified proper cleanup of allocated event filters for swipe handler. --- Telegram/SourceFiles/ui/controls/swipe_handler.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Telegram/SourceFiles/ui/controls/swipe_handler.cpp b/Telegram/SourceFiles/ui/controls/swipe_handler.cpp index f3d99f7c3d..a55634209b 100644 --- a/Telegram/SourceFiles/ui/controls/swipe_handler.cpp +++ b/Telegram/SourceFiles/ui/controls/swipe_handler.cpp @@ -76,7 +76,7 @@ void SetupSwipeHandler(SwipeHandlerArgs &&args) { bool touch = false; }; struct State { - base::unique_qptr filterContext; + base::unique_qptr filter; Ui::Animations::Simple animationReach; Ui::Animations::Simple animationEnd; SwipeContextData data; @@ -376,8 +376,8 @@ void SetupSwipeHandler(SwipeHandlerArgs &&args) { return base::EventFilterResult::Continue; }; widget->setAttribute(Qt::WA_AcceptTouchEvents); - state->filterContext = base::make_unique_q(nullptr); - base::install_event_filter(state->filterContext.get(), widget, filter); + state->filter = base::unique_qptr( + base::install_event_filter(widget, filter)); } SwipeBackResult SetupSwipeBack(