feat:avoid iOS dealloc JSValue in main thread,this may cause crash in JavaScriptCore
This commit is contained in:
@@ -237,8 +237,9 @@ - (NSDictionary *)itemModelAt:(NSUInteger)position {
|
||||
return [self subModelOf:viewId];
|
||||
} else {
|
||||
DoricAsyncResult *result = [self callJSResponse:@"renderBunchedItems", @(position), @(self.batchCount), nil];
|
||||
JSValue *models = [result waitUntilResult];
|
||||
NSArray *array = [models toArray];
|
||||
NSArray *array = [result waitUntilResult:^(JSValue *models) {
|
||||
return [models toArray];
|
||||
}];
|
||||
[array enumerateObjectsUsingBlock:^(NSDictionary *obj, NSUInteger idx, BOOL *stop) {
|
||||
NSString *thisViewId = obj[@"id"];
|
||||
[self setSubModel:obj in:thisViewId];
|
||||
|
@@ -178,8 +178,9 @@ - (NSDictionary *)itemModelAt:(NSUInteger)position {
|
||||
batchCount++;
|
||||
}
|
||||
DoricAsyncResult *result = [self callJSResponse:@"renderBunchedItems", @(start), @(batchCount), nil];
|
||||
JSValue *models = [result waitUntilResult];
|
||||
NSArray *array = [models toArray];
|
||||
NSArray *array = [result waitUntilResult:^(JSValue *models) {
|
||||
return [models toArray];
|
||||
}];
|
||||
[array enumerateObjectsUsingBlock:^(NSDictionary *obj, NSUInteger idx, BOOL *stop) {
|
||||
NSString *thisViewId = obj[@"id"];
|
||||
[self setSubModel:obj in:thisViewId];
|
||||
|
@@ -164,8 +164,9 @@ - (NSDictionary *)itemModelAt:(NSUInteger)position {
|
||||
return [self subModelOf:viewId];
|
||||
} else {
|
||||
DoricAsyncResult *result = [self callJSResponse:@"renderBunchedItems", @(index), @(self.batchCount), nil];
|
||||
JSValue *models = [result waitUntilResult];
|
||||
NSArray *array = [models toArray];
|
||||
NSArray *array = [result waitUntilResult:^(JSValue *models) {
|
||||
return [models toArray];
|
||||
}];
|
||||
[array enumerateObjectsUsingBlock:^(NSDictionary *obj, NSUInteger idx, BOOL *stop) {
|
||||
NSString *thisViewId = obj[@"id"];
|
||||
[self setSubModel:obj in:thisViewId];
|
||||
|
Reference in New Issue
Block a user