Do I need to free C variables in Objective-C code (iOS 6 with ARC)? -


if implement following within iphone code:

nsstring* soundpath = [[nsbundle mainbundle] pathforresource:soundfile oftype:@"wav"]; systemsoundid feedbacksound; audioservicescreatesystemsoundid((__bridge cfurlref) [nsurl fileurlwithpath:soundpath], &feedbacksound); audioservicesplaysystemsound(feedbacksound); 

do have free "feedbacksound" c code? leak?

i'm using arc / ios 6.

you should. correct method call is:

audioservicesdisposesystemsoundid 

(reference).

in general arc deals objective-c objects. when deal lower-level framework (core graphics, audioservices, etc.) many calls allocate memory "under hood" disposal responsible. on many occasions, have specific methods deallocation, have doing allocation.


Comments

Popular posts from this blog

how to insert data php javascript mysql with multiple array session 2 -

c++ - How to test/verify that zero-initialization takes place -

node.js - Webpack/TypeScript Raising Errors When node_modules is Excluded -