iOS: reorder registry alloc to avoid setEnvironmentVariable abnormal
This commit is contained in:
parent
15364618e1
commit
f67f0ce75a
@ -69,7 +69,7 @@ @implementation DoricJSEngine
|
|||||||
- (instancetype)init {
|
- (instancetype)init {
|
||||||
if (self = [super init]) {
|
if (self = [super init]) {
|
||||||
_initialized = NO;
|
_initialized = NO;
|
||||||
_registry = [[DoricRegistry alloc] initWithJSEngine:self];
|
|
||||||
_profile = [[DoricPerformanceProfile alloc] initWithName:@"JSEngine"];
|
_profile = [[DoricPerformanceProfile alloc] initWithName:@"JSEngine"];
|
||||||
if (_registry.globalPerformanceAnchorHook) {
|
if (_registry.globalPerformanceAnchorHook) {
|
||||||
[_profile addAnchorHook:_registry.globalPerformanceAnchorHook];
|
[_profile addAnchorHook:_registry.globalPerformanceAnchorHook];
|
||||||
@ -110,7 +110,10 @@ - (instancetype)init {
|
|||||||
@"localeLanguage": [[NSLocale currentLocale] objectForKey:NSLocaleLanguageCode] ?: @"",
|
@"localeLanguage": [[NSLocale currentLocale] objectForKey:NSLocaleLanguageCode] ?: @"",
|
||||||
@"localeCountry": [[NSLocale currentLocale] objectForKey:NSLocaleCountryCode] ?: @"",
|
@"localeCountry": [[NSLocale currentLocale] objectForKey:NSLocaleCountryCode] ?: @"",
|
||||||
}.mutableCopy;
|
}.mutableCopy;
|
||||||
|
|
||||||
|
_registry = [[DoricRegistry alloc] initWithJSEngine:self];
|
||||||
[self.registry registerMonitor:[DoricDefaultMonitor new]];
|
[self.registry registerMonitor:[DoricDefaultMonitor new]];
|
||||||
|
|
||||||
[self ensureRunOnJSThread:^() {
|
[self ensureRunOnJSThread:^() {
|
||||||
[self.profile start:@"Init"];
|
[self.profile start:@"Init"];
|
||||||
self.timers = [[NSMutableDictionary alloc] init];
|
self.timers = [[NSMutableDictionary alloc] init];
|
||||||
|
Reference in New Issue
Block a user