From 383acf0ffc489990302797ff0f048519b3c7c9bf Mon Sep 17 00:00:00 2001 From: John Preston Date: Wed, 12 May 2021 12:10:55 +0400 Subject: [PATCH] Fix crash in native notifications on Linux. --- .../platform/linux/notifications_manager_linux.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Telegram/SourceFiles/platform/linux/notifications_manager_linux.cpp b/Telegram/SourceFiles/platform/linux/notifications_manager_linux.cpp index e5a8a27ff1..82955b01ce 100644 --- a/Telegram/SourceFiles/platform/linux/notifications_manager_linux.cpp +++ b/Telegram/SourceFiles/platform/linux/notifications_manager_linux.cpp @@ -578,8 +578,9 @@ void NotificationData::show() { || _hints.find(_imageKey) == end(_hints) ? Glib::ustring(GetIconName().toStdString()) : Glib::ustring(); + const auto connection = _dbusConnection; - _dbusConnection->call( + connection->call( std::string(kObjectPath), std::string(kInterface), "Notify", @@ -595,7 +596,7 @@ void NotificationData::show() { }), [=](const Glib::RefPtr &result) { try { - auto reply = _dbusConnection->call_finish(result); + auto reply = connection->call_finish(result); const auto notificationId = GlibVariantCast( reply.get_child(0)); crl::on_main(weak, [=] {