Skip to content

Instantly share code, notes, and snippets.

@623637646
Last active May 28, 2020 11:57
Show Gist options
  • Save 623637646/3a2db30fcd00d53de7bb124fd309da8b to your computer and use it in GitHub Desktop.
Save 623637646/3a2db30fcd00d53de7bb124fd309da8b to your computer and use it in GitHub Desktop.
ReactiveObjC 3.0.0 bug. when hook NSString dealloc method, NSString can't release. Updated: This is not ReactiveObjC bug. Refer to: https://stackoverflow.com/q/62064040/9315497
int i = 0;
while (YES) {
@autoreleasepool {
NSString *string = [[NSString alloc] initWithFormat:@"%d", i];
// or
// NSString *string = [[NSString alloc] init];
[[string rac_willDeallocSignal] subscribeCompleted:^{
NSLog(@"obj dealloc");
}];
}
i++;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment