From 69de29912c7165df0149e7c9f039524fba270e5a Mon Sep 17 00:00:00 2001 From: Morgan Pretty Date: Wed, 21 Aug 2024 16:51:38 +1000 Subject: [PATCH] Clearing libSession logger when clearing data (seemed to cause crash) --- Session/Meta/SessionApp.swift | 1 + SessionUtilitiesKit/LibSession/LibSession.swift | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/Session/Meta/SessionApp.swift b/Session/Meta/SessionApp.swift index 415b12005..043f63a5d 100644 --- a/Session/Meta/SessionApp.swift +++ b/Session/Meta/SessionApp.swift @@ -112,6 +112,7 @@ public struct SessionApp { using dependencies: Dependencies, onReset: (() -> ())? = nil ) { + LibSession.clearLoggers() LibSession.clearMemoryState(using: dependencies) LibSession.clearSnodeCache() LibSession.suspendNetworkAccess() diff --git a/SessionUtilitiesKit/LibSession/LibSession.swift b/SessionUtilitiesKit/LibSession/LibSession.swift index b8487ee90..585fedee6 100644 --- a/SessionUtilitiesKit/LibSession/LibSession.swift +++ b/SessionUtilitiesKit/LibSession/LibSession.swift @@ -52,6 +52,10 @@ extension LibSession { }) } + public static func clearLoggers() { + session_clear_loggers() + } + // MARK: - Internal fileprivate enum LogCategory: String {