• 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(2): Strange crash, CFBundle*
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re(2): Strange crash, CFBundle*


  • Subject: Re(2): Strange crash, CFBundle*
  • From: Jens Bauer <email@hidden>
  • Date: Tue, 11 Dec 2001 09:31:38 +0100

Hi Douglas,

On Fri, 7 Dec, 2001, Douglas Davidson <email@hidden> wrote:

>
>On Friday, December 7, 2001, at 09:59 AM, Jens Bauer wrote:
>
>> I'm having a strange crash (periodically), in the following code:
>
>Strange crashes of this sort are often due to someone inadvertently
>releasing something in the internals of a CFBundle, that was returned to
>them by a "get" function. The release need not be anywhere in the code
>that actually crashes. Are you by any chance releasing the main bundle,
>or something else returned from it?


I've gone through much of my code, and I only (personally) release
strings I've
copied myself.

Here's a shortened down version of code I did not write myself:

static bool myfunction()
{
CFBundleRef bundle;
CFURLRef resources;

bundle = CFBundleGetMainBundle();

if(!bundle)
{
return(FALSE);
}

resources = CFBundleCopyResourcesDirectoryURL(bundle);
--> CFRelease(bundle);

if(!resources)
{
return(FALSE);
}
...
...
}



You mention that I should not release something that was returned to me by a
"get" function. Is the above CFRelease(bundle) wrong then ?


Love,
Jens


  • Follow-Ups:
    • Re: Re(2): Strange crash, CFBundle*
      • From: Douglas Davidson <email@hidden>
References: 
 >Re: Strange crash, CFBundle* (From: Douglas Davidson <email@hidden>)

  • Prev by Date: Re: cocoa-dev digest, Vol 1 #956 - 15 msgs
  • Next by Date: ucd-snmp-4.2.2
  • Previous by thread: Re(2): Strange crash, CFBundle*
  • Next by thread: Re: Re(2): Strange crash, CFBundle*
  • Index(es):
    • Date
    • Thread