From ae7fc0ad83b98771d073ee54e8bfadbd7579c33b Mon Sep 17 00:00:00 2001 From: Rcmaniac25 Date: Mon, 9 Sep 2013 00:43:31 -0400 Subject: [PATCH] Prevented case where no window was set when waiting for events. --- freeglut/freeglut/src/blackberry/fg_main_blackberry.c | 2 +- freeglut/freeglut/src/blackberry/fg_window_blackberry.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/freeglut/freeglut/src/blackberry/fg_main_blackberry.c b/freeglut/freeglut/src/blackberry/fg_main_blackberry.c index f7b8f66..e347703 100644 --- a/freeglut/freeglut/src/blackberry/fg_main_blackberry.c +++ b/freeglut/freeglut/src/blackberry/fg_main_blackberry.c @@ -160,7 +160,7 @@ fg_time_t fgPlatformSystemTime ( void ) void fgPlatformSleepForEvents( fg_time_t msec ) { //XXX: Is this right? Is there a more direct way to access the context? - if(bps_get_event(&fgStructure.CurrentWindow->Window.pContext.event, (int)msec) != BPS_SUCCESS) { + if(fgStructure.CurrentWindow && bps_get_event(&fgStructure.CurrentWindow->Window.pContext.event, (int)msec) != BPS_SUCCESS) { LOGW("BPS couldn't get event"); } } diff --git a/freeglut/freeglut/src/blackberry/fg_window_blackberry.c b/freeglut/freeglut/src/blackberry/fg_window_blackberry.c index d435dfb..5201eb5 100644 --- a/freeglut/freeglut/src/blackberry/fg_window_blackberry.c +++ b/freeglut/freeglut/src/blackberry/fg_window_blackberry.c @@ -106,7 +106,7 @@ void fgPlatformOpenWindow( SFG_Window* window, const char* title, } /* Request window events */ - screen_request_events(window->Window.pContext.screenContext); + screen_request_events(window->Window.pContext.screenContext); //XXX When multiple screens are supported, this needs to be moved to wherever the screen context is actually created /* Save window and set state */ window->Window.Handle = fgDisplay.pDisplay.single_native_window;