iOS: fix posibblely mutated crash when onException

This commit is contained in:
pengfei.zhou
2022-08-05 11:57:09 +08:00
committed by osborn
parent e042ce732e
commit fe060bdb7f
2 changed files with 6 additions and 4 deletions

View File

@@ -100,6 +100,7 @@ - (instancetype)init {
@"localeLanguage": [[NSLocale currentLocale] objectForKey:NSLocaleLanguageCode] ?: @"",
@"localeCountry": [[NSLocale currentLocale] objectForKey:NSLocaleCountryCode] ?: @"",
}.mutableCopy;
[self.registry registerMonitor:[DoricDefaultMonitor new]];
[self ensureRunOnJSThread:^() {
[self.profile start:@"Init"];
self.timers = [[NSMutableDictionary alloc] init];
@@ -111,7 +112,6 @@ - (instancetype)init {
self.initialized = YES;
[self.profile end:@"Init"];
}];
[self.registry registerMonitor:[DoricDefaultMonitor new]];
}
return self;
}