NSFontSetChangedNotification posted 20 times!
NSFontSetChangedNotification posted 20 times!
- Subject: NSFontSetChangedNotification posted 20 times!
- From: Jérome Laurens <email@hidden>
- Date: Fri, 6 Apr 2007 11:31:53 +0200
Hi,
I have got a very bad performance problem
On some circumstances, my app (an advanced text editor) is freezing
during nearly 30s.
It appears that my text view's NSLayoutManager receives a lot (20!)
of textStorage:edited:range:changeInLength:invalidatedRange: messages,
all having the same range arguments : newCharRange:{0, 32653},
invalidatedCharRange:{0, 32653}
where 32653 is exactly the length of the text.
Using gdb shows that my app freeze is caused by a
"NSFontSetChangedNotification" being posted 20 times by
CallatsDBHasChanged nearly every 1.5 second: see the gdb call stack
-[NSTextStorage _antialiasThresholdChanged:]
... notification posted
-[NSFontManager _loadFontFiles ]
fontCacheChanged
atsDBHasChanged
CallatsDBHasChanged
CFRunLoopRunSpecific
...
-[NSApplication run]
If I override
-(void)_antialiasThresholdChanged:(NSNotification *)notification;
to do nothing, no more freeze. But this is an awful hack!
The question : how come this NSFontSetChangedNotification being
posted 20 times?
can I avoid that?
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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