Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: _removeAssetsInArray objc_retain (iPhone14,4) (How to fix this bug) #56

Open
JanzenChen opened this issue Nov 22, 2022 · 0 comments

Comments

@JanzenChen
Copy link

225Thread 27 Crashed:
2260 libobjc.A.dylib 0x00000001b9cb69d0 objc_retain + [ : 16]
2271 juyousheng 0x0000000102bd7a5c -[NSMutableArray(Safe) ls_addObject:] + [NSArray+safe.m : 171]
2282 Foundation 0x00000001a27147a8 -[NSConcreteHashTable allObjects] + [ : 196]
2293 juyousheng 0x0000000102fa4040 MCSAllHashTableObjects + [MCSUtils.m : 304]
2304 juyousheng 0x0000000102f9b98c __40-[MCSAssetManager _removeAssetsInArray:]_block_invoke + [MCSAssetManager.m : 423]
2315 CoreFoundation 0x00000001a0f0d564 NSARRAY_IS_CALLING_OUT_TO_A_BLOCK + [ : 24]
2326 CoreFoundation 0x00000001a0f4be10 -[__NSArrayM enumerateObjectsWithOptions:usingBlock:] + [ : 196]
2337 juyousheng 0x0000000102f9b900 -[MCSAssetManager _removeAssetsInArray:] + [MCSAssetManager.m : 443]
2348 juyousheng 0x0000000102f9a52c __67-[MCSAssetManager removeAssetsForLastReadingTime:notIn:countLimit:]_block_invoke + [MCSAssetManager.m : 269]
2359 juyousheng 0x0000000102f9a14c -[MCSAssetManager removeAssetsForLastReadingTime:notIn:countLimit:] + [MCSAssetManager.m : 270]
23610 juyousheng 0x0000000102f90998 -[MCSAssetCacheManager _removeAssetsForLimit:] + [MCSAssetCacheManager.m : 346]
23711 juyousheng 0x0000000102f90560 -[MCSAssetCacheManager _trim] + [MCSAssetCacheManager.m : 274]
23812 libdispatch.dylib 0x00000001a0c00a30 _dispatch_client_callout + [ : 20]
23913 libdispatch.dylib 0x00000001a0c0fc90 _dispatch_lane_barrier_sync_invoke_and_complete + [ : 56]
24014 juyousheng 0x0000000102f90480 __47-[MCSAssetCacheManager _checkCachesRecursively]_block_invoke + [MCSAssetCacheManager.m : 261]
24115 libdispatch.dylib 0x00000001a0c00a30 _dispatch_client_callout + [ : 20]


[NSClassFromString(@"__NSArrayM") swizzleMethod:@selector(addObject:) withMethod:@selector(ls_addObject:)];

  • (void)ls_addObject:(id)anObject {
    if (![self isKindOfClass:NSMutableArray.class] || !anObject) {
    return;
    }
    [self ls_addObject:anObject];
    }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant