This fixes the crashes on F9 for me. We don't want to call GSgetTitleInfo2() when GSOpen() isn't finished yet.

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@5834 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
ramapcsx2.code 2014-01-25 19:36:45 +00:00
parent 7fce5709d4
commit 2ba52ebf3e
1 changed files with 12 additions and 0 deletions

View File

@ -72,6 +72,7 @@ static bool s_exclusive = true;
#ifdef _WINDOWS #ifdef _WINDOWS
static bool s_isgsopen2 = false; // boolean to remove some stuff from the config panel in new PCSX2's/ static bool s_isgsopen2 = false; // boolean to remove some stuff from the config panel in new PCSX2's/
#endif #endif
bool gsopen_done = false; // crash guard for GSgetTitleInfo2
EXPORT_C_(uint32) PS2EgetLibType() EXPORT_C_(uint32) PS2EgetLibType()
{ {
@ -185,6 +186,8 @@ EXPORT_C GSclose()
{ {
s_gs->m_wnd->Detach(); s_gs->m_wnd->Detach();
} }
gsopen_done = false;
} }
static int _GSopen(void** dsp, char* title, int renderer, int threads = -1) static int _GSopen(void** dsp, char* title, int renderer, int threads = -1)
@ -411,6 +414,8 @@ static int _GSopen(void** dsp, char* title, int renderer, int threads = -1)
return -1; return -1;
} }
gsopen_done = true;
return 0; return 0;
} }
@ -501,6 +506,8 @@ EXPORT_C_(int) GSopen(void** dsp, char* title, int mt)
s_gs->SetMultithreaded(!!mt); s_gs->SetMultithreaded(!!mt);
} }
gsopen_done = true;
return retval; return retval;
} }
@ -830,6 +837,11 @@ EXPORT_C GSgetLastTag(uint32* tag)
EXPORT_C GSgetTitleInfo2(char* dest, size_t length) EXPORT_C GSgetTitleInfo2(char* dest, size_t length)
{ {
if (gsopen_done == false) {
printf("GSdx: GSgetTitleInfo but GSOpen not yet done. Ignoring\n");
return;
}
string s = "GSdx"; string s = "GSdx";
// TODO: this gets called from a different thread concurrently with GSOpen (on linux) // TODO: this gets called from a different thread concurrently with GSOpen (on linux)