diff --git a/plugins/GSdx/GS.cpp b/plugins/GSdx/GS.cpp index e23c60d907..979820f37c 100644 --- a/plugins/GSdx/GS.cpp +++ b/plugins/GSdx/GS.cpp @@ -148,6 +148,8 @@ EXPORT_C_(int) GSinit() EXPORT_C GSshutdown() { + gsopen_done = false; + delete s_gs; s_gs = NULL; @@ -164,12 +166,12 @@ EXPORT_C GSshutdown() } #endif - - gsopen_done = false; } EXPORT_C GSclose() { + gsopen_done = false; + if(s_gs == NULL) return; s_gs->ResetDevice(); @@ -184,8 +186,6 @@ EXPORT_C GSclose() { s_gs->m_wnd->Detach(); } - - gsopen_done = false; } static int _GSopen(void** dsp, char* title, int renderer, int threads = -1) @@ -681,7 +681,8 @@ EXPORT_C GSkeyEvent(GSKeyEventData* e) { try { - s_gs->KeyEvent(e); + if (gsopen_done) + s_gs->KeyEvent(e); } catch (GSDXRecoverableError) {