• 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: "Potential" Leak of an Object Allocated...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: "Potential" Leak of an Object Allocated...


  • Subject: Re: "Potential" Leak of an Object Allocated...
  • From: Quincey Morris <email@hidden>
  • Date: Sun, 16 Sep 2012 16:20:37 -0700

On Sep 16, 2012, at 15:45 , Philip McIntosh <email@hidden> wrote:

AudioServicesCreateSystemSoundID (alertSoundFileURLRef_,&alertSoundFileObject_);

It never had this problem before. These references are set when the app launches and checks to see which sound files to use for alerts depending on what preferences are set in the Settings app.

I have not loaded it on a device yet to run it in instruments, but is there a chance this is not a memory leak at all?

Since I don' think playing the sounds with AudioServicesPlaySystemSound (alertSoundFileObject_); increases the reference count I don't really see a problem with having the reference count set at 1 after the setAlertSounds method is run. True?

It's true that there's no "problem" with the reference count being 1 at some arbitrary point in its lifetime. The potential problem is that it's never released, which depends on code you haven't quoted here.

You've assumed ownership of the sound object you create, and presumably the analyzer is telling you that it can't see where you've relinquished ownership. You'll have to show more code to get an opinion on whether the warning is a false positive.


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

This email sent to email@hidden

References: 
 >"Potential" Leak of an Object Allocated... (From: Philip McIntosh <email@hidden>)

  • Prev by Date: "Potential" Leak of an Object Allocated...
  • Next by Date: Re: Adding externally managed sources to a project
  • Previous by thread: "Potential" Leak of an Object Allocated...
  • Next by thread: Re: "Potential" Leak of an Object Allocated...
  • Index(es):
    • Date
    • Thread