NSWorkspaceDidWakeNotification crash
NSWorkspaceDidWakeNotification crash
- Subject: NSWorkspaceDidWakeNotification crash
- From: Trygve Inda <email@hidden>
- Date: Sat, 02 May 2009 04:25:34 +0000
- Thread-topic: NSWorkspaceDidWakeNotification crash
I call:
[[[NSWorkspace sharedWorkspace] notificationCenter] addObserver:self
selector:@selector(wakeNotification:) name:NSWorkspaceDidWakeNotification
object:nil];
-(void)wakeNotification:(NSNotification*)note
{
[self wake:nil]
}
-(void)wakeNotification:(NSNotification*)note
{
[self performSelector:@selector(wake:nil:) withObject:nil afterDelay:0.0];
}
The second way works more oftern, but the first way crashes in various weird
ways:
0 libobjc.A.dylib 0x9557f688 objc_msgSend + 24
1 com.apple.AppKit 0x906836cc -[NSApplication run] + 892
2 com.apple.AppKit 0x906508a4 NSApplicationMain + 574
0 libobjc.A.dylib 0x9557f68c objc_msgSend + 28
1 com.apple.CoreText 0x972392fd
TTableCacheImp::AddTable(TBaseFont const&, unsigned int, __CFData const*) +
41
2 com.apple.CoreText 0x97239213
TTableCache::CopyTable(TBaseFont const&, unsigned int) const + 227
3 com.apple.CoreText 0x97238fca
TBaseFont::CopyTable(unsigned int) const + 234
4 com.apple.CoreText 0x9727d242
TcmapTable::TcmapTable(TBaseFont const&) + 40
5 com.apple.CoreText 0x97238ea5
TBaseFont::GetGlyphsForCharacters(unsigned short const*, unsigned short*,
long) const + 25
6 com.apple.CoreText 0x9723d3b5
CTFontGetGlyphsForCharacters + 71
7 com.apple.AppKit 0x9072f56a -[__NSFontTypefaceInfo
_latin1MappingTableWithPlatformFont:hasKernPair:] + 320
8 com.apple.AppKit 0x9072f3d9 -[NSFont
_latin1MappingTable:] + 86
9 com.apple.AppKit 0x9072de6d
+[NSStringDrawingTextStorage
_fastDrawString:attributes:length:inRect:graphicsContext:baselineRendering:u
sesFontLeading:usesScreenFont:typesetterBehavior:paragraphStyle:lineBreakMod
e:boundingRect:padding:scrollable:] + 678
10 com.apple.AppKit 0x906bae5b
-[NSAttributedString(NSExtendedStringDrawing) boundingRectWithSize:options:]
+ 1253
11 com.apple.AppKit 0x9079da5f
-[NSAttributedString(NSStringDrawing) size] + 68
I am guessing that when the NSWorkspaceDidWakeNotification is received, the
system is not fully back to running and that by posting the event back to
the main loop, it gets run after things are back up and running.
Still, even the second way causes a crash sometimes.
Calling the "wake" method directly without putting the Mac to sleep never
crashes and gives the expected results. The wake method resets some timers,
reads some files, and sometimes polls a URL.
Ideas?
Trygve
_______________________________________________
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