commit | 9719341f7c98a27e7e0498c5a5875a915b5b6ddf | [log] [tgz] |
---|---|---|
author | Kateryna Kostiuk <katryna.kostiuk@savoirfairelinux.com> | Tue Apr 11 11:06:14 2023 -0400 |
committer | Kateryna Kostiuk <kateryna.kostiuk@savoirfairelinux.com> | Tue Apr 11 11:50:37 2023 -0400 |
tree | dfda769d0617951a7f037b113ca619a443982117 | |
parent | 8483442f76507d1ed4c839b4d7427caa24393c56 [diff] [blame] |
notifications: leave dispatch group when timeout occurs This patch stops tasks for the dispatch group when the notification extension times out, to prevent potential memory leaks. Change-Id: I1b69500d4026a5244d49c728887a1c4fd55a3fd2
diff --git a/Ring/jamiNotificationExtension/NotificationService.swift b/Ring/jamiNotificationExtension/NotificationService.swift index a7c9b88..917810e 100644 --- a/Ring/jamiNotificationExtension/NotificationService.swift +++ b/Ring/jamiNotificationExtension/NotificationService.swift
@@ -156,6 +156,10 @@ } override func serviceExtensionTimeWillExpire() { + if !self.tasksCompleted { + self.tasksCompleted = true + self.tasksGroup.leave() + } finish() }