From 30c23a812960e63d7169cc39216ea465df92b152 Mon Sep 17 00:00:00 2001 From: Chris Danford Date: Thu, 22 Sep 2005 18:18:04 +0000 Subject: [PATCH] fix AV if lose focus while initializing --- stepmania/src/StepMania.cpp | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/stepmania/src/StepMania.cpp b/stepmania/src/StepMania.cpp index 426b210d10..ca42e91c81 100644 --- a/stepmania/src/StepMania.cpp +++ b/stepmania/src/StepMania.cpp @@ -324,12 +324,17 @@ static bool ChangeAppPri() { vector vDevices; vector vDescriptions; - INPUTMAN->GetDevicesAndDescriptions(vDevices,vDescriptions); - CString sInputDevices = join( ",", vDescriptions ); - if( sInputDevices.Find("NTPAD") != -1 ) + + // This can get called before INPUTMAN is constructed. + if( INPUTMAN ) { - LOG->Trace( "Using NTPAD. Don't boost priority." ); - return false; + INPUTMAN->GetDevicesAndDescriptions(vDevices,vDescriptions); + CString sInputDevices = join( ",", vDescriptions ); + if( sInputDevices.Find("NTPAD") != -1 ) + { + LOG->Trace( "Using NTPAD. Don't boost priority." ); + return false; + } } } #endif