Skip to content

Commit 80b170f

Browse files
authored
Merge pull request #87 from zrina1314/master
fix: Fixing the reload feature on ios that causes multiple file writes
2 parents f7207f4 + e5a9cc4 commit 80b170f

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

ios/FileLogger.mm

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717

1818
@interface FileLogger () <MFMailComposeViewControllerDelegate>
1919
@property (nonatomic, strong) DDFileLogger* fileLogger;
20+
2021
@end
2122

2223
@implementation FileLogger
@@ -143,7 +144,12 @@ - (dispatch_queue_t)methodQueue {
143144
- (void)mailComposeController:(MFMailComposeViewController*)controller didFinishWithResult:(MFMailComposeResult)result error:(NSError*)error {
144145
[controller dismissViewControllerAnimated:YES completion:nil];
145146
}
146-
147+
- (void)dealloc
148+
{
149+
if (self.fileLogger) {
150+
[DDLog removeLogger:self.fileLogger];
151+
}
152+
}
147153
// Don't compile this code when we build for the old architecture.
148154
#ifdef RCT_NEW_ARCH_ENABLED
149155
- (std::shared_ptr<facebook::react::TurboModule>)getTurboModule:

0 commit comments

Comments
 (0)