From a3cdf19c1fb3816604a96e4a8b56c3b2dac5fc65 Mon Sep 17 00:00:00 2001 From: Ilya Fedin Date: Fri, 16 Jun 2023 11:59:40 +0400 Subject: [PATCH] Ensure Wayland integration instance accessor doesn't leak --- .../platform/linux/linux_wayland_integration.cpp | 15 +++++++++------ Telegram/lib_base | 2 +- Telegram/lib_ui | 2 +- 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/Telegram/SourceFiles/platform/linux/linux_wayland_integration.cpp b/Telegram/SourceFiles/platform/linux/linux_wayland_integration.cpp index 064fb818b..b6cc6c888 100644 --- a/Telegram/SourceFiles/platform/linux/linux_wayland_integration.cpp +++ b/Telegram/SourceFiles/platform/linux/linux_wayland_integration.cpp @@ -123,12 +123,15 @@ WaylandIntegration::~WaylandIntegration() = default; WaylandIntegration *WaylandIntegration::Instance() { if (!IsWayland()) return nullptr; static std::optional instance(std::in_place); - base::qt_signal_producer( - QGuiApplication::platformNativeInterface(), - &QObject::destroyed - ) | rpl::start_with_next([&] { - instance = std::nullopt; - }, instance->_private->lifetime); + [[maybe_unused]] static const auto Inited = [] { + base::qt_signal_producer( + QGuiApplication::platformNativeInterface(), + &QObject::destroyed + ) | rpl::start_with_next([] { + instance = std::nullopt; + }, instance->_private->lifetime); + return true; + }(); if (!instance) return nullptr; return &*instance; } diff --git a/Telegram/lib_base b/Telegram/lib_base index e0763c0c7..249814b33 160000 --- a/Telegram/lib_base +++ b/Telegram/lib_base @@ -1 +1 @@ -Subproject commit e0763c0c7ae38c89e09b0d41080293a0cb77ecde +Subproject commit 249814b3343c5ed06b56597ac870df81c77f8417 diff --git a/Telegram/lib_ui b/Telegram/lib_ui index 1e89c19a0..8a5604880 160000 --- a/Telegram/lib_ui +++ b/Telegram/lib_ui @@ -1 +1 @@ -Subproject commit 1e89c19a03ddd654e063e26fbb5223247212822d +Subproject commit 8a560488011f833b7ba534999f878d20d5152e6c