• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: How do I release multiple instance of AVAudioPlayer
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How do I release multiple instance of AVAudioPlayer


  • Subject: Re: How do I release multiple instance of AVAudioPlayer
  • From: David Duncan <email@hidden>
  • Date: Sun, 25 Jul 2010 10:01:45 -0700

On Jul 25, 2010, at 9:38 AM, Sanoj Nambi wrote:

I guess AVAudioPlayer internally maintains a pool and flushes it if a certain number of objects are created.

I think you are making an unwarranted assumption here...

        playBeat = [[[AVAudioPlayer alloc] initWithContentsOfURL:filePath error:&error]retain];

This is almost certainly incorrect. You should almost never be retaining the object you get back from a +alloc method, as it is already owned by you.

I would highly recommend you read <http://developer.apple.com/iphone/library/documentation/cocoa/Conceptual/MemoryMgmt/MemoryMgmt.html>

I have not released the playBeat object anywhere.

If you never release your owning reference to the AVAudioPlayers, then how do you expect them to be released at all?

--

Reality is what, when you stop believing in it, doesn't go away.

Failure is not an option. It is a privilege reserved for those who try.


David Duncan


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >How do I release multiple instance of AVAudioPlayer (From: Sanoj Nambi <email@hidden>)

  • Prev by Date: How do I release multiple instance of AVAudioPlayer
  • Next by Date: Getting distorted sound from AU
  • Previous by thread: How do I release multiple instance of AVAudioPlayer
  • Next by thread: Re: How do I release multiple instance of AVAudioPlayer
  • Index(es):
    • Date
    • Thread