From e5a9cc4c5bb61d8410b90573715310b07ab544d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=91=A8=E9=A2=96=E9=A3=9E?= Date: Thu, 3 Jul 2025 14:03:00 +0800 Subject: [PATCH] fix: Fixing the reload feature on ios that causes multiple file writes --- ios/FileLogger.mm | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/ios/FileLogger.mm b/ios/FileLogger.mm index cda4922..3f9a06a 100644 --- a/ios/FileLogger.mm +++ b/ios/FileLogger.mm @@ -17,6 +17,7 @@ @interface FileLogger () @property (nonatomic, strong) DDFileLogger* fileLogger; + @end @implementation FileLogger @@ -143,7 +144,12 @@ - (dispatch_queue_t)methodQueue { - (void)mailComposeController:(MFMailComposeViewController*)controller didFinishWithResult:(MFMailComposeResult)result error:(NSError*)error { [controller dismissViewControllerAnimated:YES completion:nil]; } - +- (void)dealloc +{ + if (self.fileLogger) { + [DDLog removeLogger:self.fileLogger]; + } +} // Don't compile this code when we build for the old architecture. #ifdef RCT_NEW_ARCH_ENABLED - (std::shared_ptr)getTurboModule: