From 3fdd6848c58582924cdb90b734d17581db193811 Mon Sep 17 00:00:00 2001 From: John Preston Date: Thu, 5 Nov 2020 15:05:29 +0300 Subject: [PATCH] Fix possible crash on macOS wake. --- Telegram/SourceFiles/platform/mac/specific_mac_p.mm | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Telegram/SourceFiles/platform/mac/specific_mac_p.mm b/Telegram/SourceFiles/platform/mac/specific_mac_p.mm index 6b9cc508a..b4208a042 100644 --- a/Telegram/SourceFiles/platform/mac/specific_mac_p.mm +++ b/Telegram/SourceFiles/platform/mac/specific_mac_p.mm @@ -157,11 +157,13 @@ ApplicationDelegate *_sharedDelegate = nil; } - (void) receiveWakeNote:(NSNotification*)aNotification { - if (Core::IsAppLaunched()) { - Core::App().checkLocalTime(); + if (!Core::IsAppLaunched()) { + return; } + Core::App().checkLocalTime(); - LOG(("Audio Info: -receiveWakeNote: received, scheduling detach from audio device")); + LOG(("Audio Info: " + "-receiveWakeNote: received, scheduling detach from audio device")); Media::Audio::ScheduleDetachFromDeviceSafe(); }