• 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: Memory Leak was Re: NSAppleEventManager problems
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Memory Leak was Re: NSAppleEventManager problems


  • Subject: Re: Memory Leak was Re: NSAppleEventManager problems
  • From: Mark Piccirelli <email@hidden>
  • Date: Tue, 23 Oct 2001 14:35:04 -0700

Rosyna --

I've looked into this problem. It does appear to be caused by a bug of ours. A few objects that are allocated during the handling of each Apple event are being put in an autorelease pool that's not deallocated until some non-AE-related event is handled. Sorry for the trouble it caused.

And no, you really weren't responsible for releasing the NSAppleEventDescriptor objects passed into your Apple event handler method.

-- Mark

On Monday, October 22, 2001, at 08:19 AM, Rosyna wrote:

There is definitely a Memory leak with NSAppleEventManager when it receives events. I changed it to use NSDistributedNotifications and the leak is gone, nothing in the function was changed at all.

Ack, at 10/19/01, Rosyna said:

I think i am having a memory leak when I use AppleEvent Handlers when installing them like this:

[[NSAppleEventManager sharedAppleEventManager] setEventHandler: self andSelector:@selector(zip:) forEventClass: 'CMMf' andEventID: 'zip '];

The implementation looks like this:

-(void) zip:(id)sender
{
if (added==NO && [[NSUserDefaults standardUserDefaults] boolForKey:NSLocalizedString(@"Show Menu",@"")])
[self installMenu];
added=YES;
}

The application receives an AppleEvent matching this criteria every 1.5 seconds (don't ask why, it's important that it does it this often) After a few seconds, the memory starts going up everytime it receives sad AppleEvent.

Any clues why it could be leaking (that's all its doing, installMenu isn't even being called.)
-- Sincerely,
Rosyna Keller
Technical Support/Holy Knight/Always needs a hug

Unsanity: Unsane Tools for Insane People
_______________________________________________
cocoa-dev mailing list
email@hidden
http://www.lists.apple.com/mailman/listinfo/cocoa-dev


References: 
 >Memory Leak was Re: NSAppleEventManager problems (From: Rosyna <email@hidden>)

  • Prev by Date: Q about responder chain
  • Next by Date: Re: Child threads and the UI
  • Previous by thread: Memory Leak was Re: NSAppleEventManager problems
  • Next by thread: Re: display special characters
  • Index(es):
    • Date
    • Thread