Leaks program

Posts: 306
Joined: 2009.03
Post: #1
What qualifies as a leak in this tool?
I had been using AVAudioPlayer where I set the delegate to point to an object which would then delete the player when it finished. So This is a weak refrence to my Object and I did not hold onto the AVAudioPlayer anywhere else. I plan to hold onto all of these in a list now for safety reasons(what if this method doesn't happen etc) but it got me thinking about what is considered a leak. I also get leaks in things that don't have any of my code in the creation stack trace so I am not sure how I am leaking those.
Quote this message in a reply
Posts: 133
Joined: 2008.05
Post: #2
A leak is when you no longer have a reference to block of allocated memory.

Believe it or not, the SDK isn't perfect. There are leaks in Apple's code. If you check out the stack trace of a leak and don't see any methods you wrote, it is Apple's code that is leaking.

Leaks aren't the end of the world, especially tiny ones at startup.
Quote this message in a reply
Posts: 306
Joined: 2009.03
Post: #3
I seem to get a tiny leak every time i play an audio file. I dont reuse audio players because I want there to be a dynamic # of players for possibly the same sound since its tied to a unit in the game. I made sure to store all AV players in an array and clean them up every so often if they are not playing anymore. Still I see a leak happening. The leak trace does have my creation of the av player, but then a ton more code ending in a malloc call. Im not sure what I am doing wrong, the leak is small so it cannot be the whole av player leaking. Anyone have experience with this?
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  does the app store accept games with leaks? aerospaceman 5 8,256 Mar 15, 2011 01:59 PM
Last Post: aerospaceman
  Looking for some insight while fixing leaks... agreendev 2 4,429 Sep 28, 2010 11:57 AM
Last Post: agreendev
  Advice on fixing memory leaks petemccabe 4 5,186 Jun 24, 2010 09:19 AM
Last Post: petemccabe
  Leaks in the waterworks. bmantzey 5 5,607 Feb 27, 2009 04:07 PM
Last Post: AnotherJake