diff --git a/ChangeLog b/ChangeLog index 68f7c783f..f162fa53f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2010-04-23 Jonathan Gillaspie + + * Headers/AppKit/NSGraphics.h: NSBeep() - Don't crash when a + graphics context isn't available (eg - from a subthread). + + 2010-04-23 Wolfgang Lux * Source/NSAlert.m (NSRunAlertPanel): Fix incorrect return code diff --git a/Headers/AppKit/NSGraphics.h b/Headers/AppKit/NSGraphics.h index 87d598d7d..a76db1d4f 100644 --- a/Headers/AppKit/NSGraphics.h +++ b/Headers/AppKit/NSGraphics.h @@ -180,8 +180,10 @@ static inline void NSBeep(void) { NSGraphicsContext *ctxt = GSCurrentContext(); - (ctxt->methods->NSBeep) - (ctxt, @selector(NSBeep)); + if (ctxt != nil) { + (ctxt->methods->NSBeep) + (ctxt, @selector(NSBeep)); + } } static inline void