• 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: Over-release caused by Instruments?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Over-release caused by Instruments?


  • Subject: Re: Over-release caused by Instruments?
  • From: Dave Keck <email@hidden>
  • Date: Tue, 2 Nov 2010 00:38:19 -0400

Thanks all for the suggestions. I've studied the code more thoroughly
and can't find any possible races – it's a pretty run-of-the-mill
producer/consumer model:

===== Producer =====

components = [NSMutableArray array];
message = [NSPortMessage initWith... components: components];
@synchronized(messages)
{
  [messages addObject: message];
}

===== Consumer =====

@synchronized(messages)
{
  message = [[[messages objectAtIndex: 0] retain] autorelease];
  [messages removeObjectAtIndex: 0];
}
[delegate handlePortMessage: message];

==========

Where the `components` array is the object supposedly being
over-released, and is never used beyond being populated and then
supplied to NSPortMessage's initializer, all on the producer thread.
Interestingly, the over-release disappears if the producer looks like
this:

===== Producer (works) =====

components = [[NSMutableArray alloc] init];
message = [NSPortMessage initWith... components: components];
@synchronized(messages)
{
  [messages addObject: message];
}
[components release];

==========

I'm completely stumped; I'll see if I can distill the code down to
something that I can post to the list.
 _______________________________________________
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: 
 >Over-release caused by Instruments? (From: Dave Keck <email@hidden>)
 >Re: Over-release caused by Instruments? (From: Bill Bumgarner <email@hidden>)

  • Prev by Date: Re: Over-release caused by Instruments?
  • Next by Date: Source level debug config for OpenSSL 1.0.0a?
  • Previous by thread: Re: Over-release caused by Instruments?
  • Next by thread: Source level debug config for OpenSSL 1.0.0a?
  • Index(es):
    • Date
    • Thread