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

Autorelease pool


  • Subject: Autorelease pool
  • From: Michael Süssner <email@hidden>
  • Date: Wed, 7 Oct 2009 23:53:25 +0200

I habe created a small shell programm using Cocoa Foundation class for test purposes.

After my test program has passed successfully the drain method of the autorelease buffer is called and "sometimes" I get the following error:
Program received signal: “EXC_BAD_ACCESS”.
sharedlibrary apply-load-rules all



How can I track which object has already been release:



The code is rather simple:
void printPolygonInfo()
{
PolygonShape * vPolygon;
NSString *str;
int i;
NSArray *vPolyArray = [NSArray arrayWithObjects:
[[PolygonShape alloc] initWithNumberOfSides:4 minimumNumberOfSides:3 maximumNumberOfSides:7],
[[PolygonShape alloc] initWithNumberOfSides:6 minimumNumberOfSides:5 maximumNumberOfSides:9],
[[PolygonShape alloc] initWithNumberOfSides:11 minimumNumberOfSides:9 maximumNumberOfSides:12],
nil];

for (vPolygon in vPolyArray){
NSLog(@"%@\n Retain Count:%d",[vPolygon description], [vPolygon retainCount]);
}

NSLog(@"Try to set number of sides equal 10\n\n");
for (vPolygon in vPolyArray){
vPolygon.numberOfSides = 10;
}
[vPolyArray release];

}


When I delete the NSLog line, then the code seems to run fine. Even the retaincount is 2, so??

Any suggestions?
Michael

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Autorelease pool
      • From: Wim Lewis <email@hidden>
    • Re: Autorelease pool
      • From: Dave Carrigan <email@hidden>
    • Re: Autorelease pool
      • From: Shawn Erickson <email@hidden>
    • Re: Autorelease pool
      • From: Nick Zitzmann <email@hidden>
  • Prev by Date: Understanding CFMakeCollectable (was: EXC_BAD_ACCESS when -fobjc-gc)
  • Next by Date: Window maxSize different from setMaxSize ???
  • Previous by thread: Using Security framework to write self-limiting app without modifying /etc/authorization?
  • Next by thread: Re: Autorelease pool
  • Index(es):
    • Date
    • Thread