From 90135f15b958d52eeba671f5ce700aaa2dae2517 Mon Sep 17 00:00:00 2001 From: jonathanosx Date: Fri, 23 Apr 2010 17:23:43 +0000 Subject: [PATCH] * Headers/AppKit/NSGraphics.h: NSBeep() - Don't crash when a graphics context isn't available (eg - from a subthread). git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@30226 72102866-910b-0410-8b05-ffd578937521 --- ChangeLog | 6 ++++++ Headers/AppKit/NSGraphics.h | 6 ++++-- 2 files changed, 10 insertions(+), 2 deletions(-) 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