开发者

memory leak using CFBundleCopyResourceURL

Instruments tells me, that I'm leaking memory with the following lines of code

    CFBundleRef mainBundle = CFBundleGetMainBundle ();
    CFStringRef aString =CFStringCreateWithFormat(NULL, NULL, CFSTR("%i"),aNumber);         开发者_开发技巧           
    sound= CFBundleCopyResourceURL (mainBundle, aString, CFSTR ("aiff"), NULL);
    CFRelease(aString);

I do release sound - which is of course a CFURLRef - in the dealloc of this class (which by the way is a subclass of UIView) using CFRelease.

The culprits seem to be a NSURL and a NSCFString.

But what else can I do apart from releasing sound and aString?


Use breakpoints to interact with the variable in question, that way you will likely solve your problem.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜