commit 8af11547716be1108f462f922ced3d2e33488de2
Author: Vitaly Zaitsev <vitaly(a)easycoding.org>
Date: Wed Oct 10 14:42:26 2018 +0200
Backported patch with crash fix on logout.
telegram-desktop-logout-crash-fix.patch | 46 +++++++++++++++++++++++++++++++++
telegram-desktop.spec | 7 ++++-
2 files changed, 52 insertions(+), 1 deletion(-)
---
diff --git a/telegram-desktop-logout-crash-fix.patch
b/telegram-desktop-logout-crash-fix.patch
new file mode 100644
index 0000000..ba459ed
--- /dev/null
+++ b/telegram-desktop-logout-crash-fix.patch
@@ -0,0 +1,46 @@
+From 1ec9137fd7fa44516d3b1bb700464407c89e5003 Mon Sep 17 00:00:00 2001
+From: John Preston <johnprestonmail(a)gmail.com>
+Date: Wed, 10 Oct 2018 08:29:31 +0300
+Subject: [PATCH] Clear locations data on logout. Fixes a crash.
+
+Also clear user notification center delegate on macOS.
+---
+ Telegram/SourceFiles/app.cpp | 4 +++-
+ .../SourceFiles/platform/mac/notifications_manager_mac.mm | 2 ++
+ 2 files changed, 5 insertions(+), 1 deletion(-)
+
+diff --git a/Telegram/SourceFiles/app.cpp b/Telegram/SourceFiles/app.cpp
+index e794571f3..984f17d2b 100644
+--- a/Telegram/SourceFiles/app.cpp
++++ b/Telegram/SourceFiles/app.cpp
+@@ -1255,7 +1255,6 @@ namespace App {
+
+ void historyClearMsgs() {
+ ::dependentItems.clear();
+-
+ const auto oldData = base::take(msgsData);
+ const auto oldChannelData = base::take(channelMsgsData);
+ for (const auto item : oldData) {
+@@ -1266,6 +1265,9 @@ namespace App {
+ delete item;
+ }
+ }
++ for (const auto data : base::take(::locationsData)) {
++ delete data;
++ }
+
+ clearMousedItems();
+ }
+diff --git a/Telegram/SourceFiles/platform/mac/notifications_manager_mac.mm
b/Telegram/SourceFiles/platform/mac/notifications_manager_mac.mm
+index 49836a697..d385425a8 100644
+--- a/Telegram/SourceFiles/platform/mac/notifications_manager_mac.mm
++++ b/Telegram/SourceFiles/platform/mac/notifications_manager_mac.mm
+@@ -317,6 +317,8 @@ void FlashBounce() {
+ putClearTask(ClearFinish());
+ _clearingThread.join();
+ }
++ NSUserNotificationCenter *center = [NSUserNotificationCenter
defaultUserNotificationCenter];
++ [center setDelegate:nil];
+ [_delegate release];
+ }
+
diff --git a/telegram-desktop.spec b/telegram-desktop.spec
index 7da18aa..31e1fc7 100644
--- a/telegram-desktop.spec
+++ b/telegram-desktop.spec
@@ -11,7 +11,7 @@
Summary: Telegram Desktop official messaging app
Name: telegram-desktop
Version: 1.4.2
-Release: 1%{?dist}
+Release: 2%{?dist}
# Application and 3rd-party modules licensing:
# * S0 (Telegram Desktop) - GPLv3+ with OpenSSL exception -- main source;
@@ -30,6 +30,8 @@ Patch0: %{name}-build-fixes.patch
Patch1: %{name}-api-tokens.patch
Patch2: %{name}-system-fonts.patch
+Patch100: %{name}-logout-crash-fix.patch
+
%{?_qt5:Requires: %{_qt5}%{?_isa} = %{_qt5_version}}
Recommends: libappindicator-gtk3%{?_isa}
Requires: qt5-qtimageformats%{?_isa}
@@ -143,6 +145,9 @@ appstream-util validate-relax --nonet
"%{buildroot}%{_datadir}/metainfo/%{name}.
%{_datadir}/metainfo/%{name}.appdata.xml
%changelog
+* Wed Oct 10 2018 Vitaly Zaitsev <vitaly(a)easycoding.org> - 1.4.2-2
+- Backported patch with crash fix on logout.
+
* Tue Oct 09 2018 Vitaly Zaitsev <vitaly(a)easycoding.org> - 1.4.2-1
- Updated to 1.4.2.
Show replies by date