cocoafob
cocoafob copied to clipboard
Memory Leak in CFobLicVerifier?
I think there may be a memory leak in CFobLicVerifier when compiled with ARC (I'm running Xcode 7.2.1/ OS X 10.11.3).
@property (retain) __attribute__((NSObject)) SecKeyRef publicKey;
If I take that out, set the publicKey ivar directly and retain it (and release it when I'm done) that seemed to get rid of the leak.
I'll need to investigate, thanks for reporting
@AppTyrant @glebd
I noticed this as well while profiling.
In addition to the purposed adjustment from AppTyrant, another possible solution would be to add an else condition with CFobLicVerifier Lifecycle portion and CFRelease(_publicKey)
when compiled with ARC:
#pragma mark -
#pragma mark Lifecycle
#if !__has_feature(objc_arc)
- (void)finalize
{
self.publicKey = nil;
[super finalize];
}
- (void)dealloc
{
self.publicKey = nil;
self.blacklist = nil;
[super dealloc];
}
#else
- (void)dealloc
{
CFRelease(_publicKey);
}
#endif
Let me know if you'd like me to issue a PR.