• 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
More autorelease pool strangeness
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

More autorelease pool strangeness


  • Subject: More autorelease pool strangeness
  • From: Skip Haughay <email@hidden>
  • Date: Mon, 20 Nov 2006 03:48:44 -0800


I am having a real problem finding a memory leak in a framework.  I need some suggestions on how to find this thing.

An application calls loads this framework and calls an entry-point function within:

resultType EntryPoint
{
	NSAutoreleasePool *thePool;

	thePool = [[NSAutoreleasePool alloc] init];

        // Function calls to do the work - problematic allocation is made in one of the called functions.


         [thePool release];
}

There is one particular object type that is allocated in the called functions, which contains a couple of NSArray fields.  This object is  autoreleased by its factory method, and the parent object retains it.  As the program executes, several other data structures may retain this item.  I overrode the release/retain items in the object of interest in order to display via NSLog the current retainCount of the objects of interest.

Anyway, on the last series of releases of objects of this type, the retainCount is 1.  The code then comes to [thePool release] which should, in theory, decrement the retainCount on any listed item, allowing the runtime to clean things up.  This does not seem to happen... the dealloc is never called for these objects, as [thePool release] is called, and control goes from the framework back to the calling application.

When I subsequently examine the process of itnerest using the "leaks" command-line call, I see that this object of interest is showing up as leaked.   Any ideas as to what would cause this?  Any ideas on how to debug this, or what could cause this odd behavior?


Skip Haughay


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

This email sent to email@hidden

  • Follow-Ups:
    • Re: More autorelease pool strangeness
      • From: "Alan Smith" <email@hidden>
  • Prev by Date: Re: Re: Re: Launch bundled application before main application
  • Next by Date: Paste from a data stream
  • Previous by thread: Re: closing sockets
  • Next by thread: Re: More autorelease pool strangeness
  • Index(es):
    • Date
    • Thread