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

NSMutableDictionary Leak


  • Subject: NSMutableDictionary Leak
  • From: dct <email@hidden>
  • Date: Fri, 28 Nov 2008 16:04:17 -0800

I've started using Instruments/Leaks on a project that has been building and running as expected. It has identified a goodly number of CFDictionary leaks (a Malloc leak followed by an Autorelease leak) associated with lines that, in one typical case, reads:

[tmp setObject:[NSDictionary dictionaryWithDictionary:tmp2] forKey:@"Data"];

The MutableDictionary object "tmp" is instantiated at the beginning of this particular method by:

NSMutableDictionary *tmp = [[NSMutableDictionary dictionaryWithCapacity:4] autorelease];

Do I need to autorelease  a la:

[tmp setObject:[[NSDictionary dictionaryWithDictionary:tmp2] autorelease] forKey:@"Data"];

or is this a non-problem given that the reported Malloc leak is followed by an Autorelease leak?


_______________________________________________


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: NSMutableDictionary Leak
      • From: "Michael Ash" <email@hidden>
    • Re: NSMutableDictionary Leak
      • From: Dave DeLong <email@hidden>
    • Re: NSMutableDictionary Leak
      • From: Bill Bumgarner <email@hidden>
  • Prev by Date: Re: Text blurred in application
  • Next by Date: Re: Sort Through Commas in Cocoa
  • Previous by thread: Re: NSMutableArray vs NSArrayController
  • Next by thread: Re: NSMutableDictionary Leak
  • Index(es):
    • Date
    • Thread