• 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: -[NSMenu popUpContextMenu:withEvent:forView:] crashing in __isSystemFont on 10.5.2
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: -[NSMenu popUpContextMenu:withEvent:forView:] crashing in __isSystemFont on 10.5.2


  • Subject: Re: -[NSMenu popUpContextMenu:withEvent:forView:] crashing in __isSystemFont on 10.5.2
  • From: Aki Inoue <email@hidden>
  • Date: Fri, 7 Mar 2008 14:11:04 -0800

One of the biggest changes in Leopard is that NSFont instances are now under normal memory management rules.
They deallocate/finalize just as other objects.


Up until Tiger, they never got deallocated (and was one of the biggest headaches in resource management).

This is an excerpt from AppKit release note.

Aki

NSFont
The AppKit framework no longer retains NSFont instances, and they are subject to the standard retain/release scheme. For debugging purpose, you can use the NSDisableFontDeallocation key. When the value is YES, font instances are not deallocated. Also, by setting NSFontDebugLevel to non-0 value, memory space previously occupied by NSFont is more aggressively reclaimed to allow finding over-released instances easily.


On 2008/03/07, at 13:57, Ben Lachman wrote:

EXC_BAD_ACCESS. But I think I found the issue. I wasn't retaining the font returned by menuFontForSize:. What threw me off was that this never caused a problem in Tiger (perhaps it is a static instance that is returned there) but did on Leopard. No idea of the reason for the change though.

Thanks,
->Ben
--
Ben Lachman
Acacia Tree Software

http://acaciatreesoftware.com

email@hidden
740.590.0009



On Mar 7, 2008, at 4:49 PM, Kyle Sluder wrote:

On Fri, Mar 7, 2008 at 4:31 PM, Ben Lachman <email@hidden> wrote:
In my custom view I call [NSMenu popUpContextMenu:contextMenu
withEvent:theEvent forView:self] during mousDown: in some cases. It
sometimes crashes during this call in [NSFont __isSystemFont]. The
menu I'm giving it has multiple sizes of the default menu font in it.
Any ideas why this is happening? Same code works fine on Tiger.

What's the actual crash?

--Kyle Sluder

_______________________________________________

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

_______________________________________________

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


References: 
 >-[NSMenu popUpContextMenu:withEvent:forView:] crashing in __isSystemFont on 10.5.2 (From: Ben Lachman <email@hidden>)
 >Re: -[NSMenu popUpContextMenu:withEvent:forView:] crashing in __isSystemFont on 10.5.2 (From: "Kyle Sluder" <email@hidden>)
 >Re: -[NSMenu popUpContextMenu:withEvent:forView:] crashing in __isSystemFont on 10.5.2 (From: Ben Lachman <email@hidden>)

  • Prev by Date: Re: -[NSMenu popUpContextMenu:withEvent:forView:] crashing in __isSystemFont on 10.5.2
  • Next by Date: Re: How to set a custom glyph generator?
  • Previous by thread: Re: -[NSMenu popUpContextMenu:withEvent:forView:] crashing in __isSystemFont on 10.5.2
  • Next by thread: NSImageViewing & No Bindings available ...
  • Index(es):
    • Date
    • Thread