diff --git a/Telegram/SourceFiles/platform/linux/notifications_manager_linux.cpp b/Telegram/SourceFiles/platform/linux/notifications_manager_linux.cpp index 835aceffa..67abd46b8 100644 --- a/Telegram/SourceFiles/platform/linux/notifications_manager_linux.cpp +++ b/Telegram/SourceFiles/platform/linux/notifications_manager_linux.cpp @@ -141,7 +141,7 @@ bool UseGNotification() { } // namespace -class Manager::Private { +class Manager::Private : public base::has_weak_ptr { public: explicit Private(not_null manager); @@ -750,7 +750,7 @@ void Manager::Private::showNotification( const auto callbackWrap = gi::unwrap( Gio::AsyncReadyCallback( - crl::guard(weak, [=]( + crl::guard(this, [=]( GObject::Object, Gio::AsyncResult res) { auto &sandbox = Core::Sandbox::Instance(); @@ -767,6 +767,13 @@ void Manager::Private::showNotification( return; } + if (!weak) { + _interface.call_close_notification( + std::get<1>(*result), + nullptr); + return; + } + weak->id = std::get<1>(*result); }); })),