From 370ad0aa4468d8b568f5219c0e3b95e63df0b025 Mon Sep 17 00:00:00 2001 From: John Preston Date: Wed, 1 Jul 2020 19:35:25 +0400 Subject: [PATCH] Fix critical memory leak on macOS. --- .../SourceFiles/platform/mac/notifications_manager_mac.mm | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Telegram/SourceFiles/platform/mac/notifications_manager_mac.mm b/Telegram/SourceFiles/platform/mac/notifications_manager_mac.mm index a298876c3..088a43bf9 100644 --- a/Telegram/SourceFiles/platform/mac/notifications_manager_mac.mm +++ b/Telegram/SourceFiles/platform/mac/notifications_manager_mac.mm @@ -303,6 +303,8 @@ void Manager::Private::clearingThreadLoop() { _clearingTasks.clear(); } + @autoreleasepool { + auto clearBySpecial = [&](NSDictionary *notificationUserInfo) { NSNumber *sessionObject = [notificationUserInfo objectForKey:@"session"]; const auto notificationSessionId = sessionObject ? [sessionObject unsignedLongLongValue] : 0; @@ -334,6 +336,8 @@ void Manager::Private::clearingThreadLoop() { } } } + + } } }