NSCF String Leak without use of a string
I am working on mounting some network shares in a program. The URL and username are saved in a dictionary with the password coming in from the keychain which is changed to a NSString, used and released. I have traced the only memory leak to the actual mounting of the server:
error = FSMountServerVolumeSync((CFURLRef) [objects objectForKey:@"url"], NULL, (CFStringRef) [objects objectForKey:@"username"],(CFStringRef) password, NULL, 0);
The object for "url" is a NSURL and the username is a NSString.
In the leak performance tool it says: Leaked Object: NSCFString responsable library: smb, responsable frame: smb_url_to_dictionary
If I look at the history it is a CFString malloc for 32 bytes and then goes through 8 iterations of CFRetain-CFRelease from smb and NetFS li开发者_StackOverflow社区braries which results in a +1 retain count.
Being new to Objective-C and memory management I thought I was doing everything correct I have released everything alloc'd and really not sure how this leak is occurring.
Is there something with the FSMountServerVolumeSync that is tricky thats causing this leak?
Is there any way to look during runtime at the memory location to determine what is there to see what the leak is from?
Also what does the NSCF stand for?
Thanks for the help
精彩评论