Qt: Fix crash on invalid ROM loads

This commit is contained in:
Jeffrey Pfau 2016-02-21 12:57:31 -08:00
parent aa0ee743b3
commit 123dc18398
1 changed files with 10 additions and 7 deletions

View File

@ -306,6 +306,16 @@ void GameController::openGame(bool biosOnly) {
return;
}
if (!biosOnly) {
m_threadContext.core = mCoreFind(m_fname.toUtf8().constData());
} else {
m_threadContext.core = GBACoreCreate();
}
if (!m_threadContext.core) {
return;
}
m_gameOpen = true;
m_pauseAfterFrame = false;
@ -317,13 +327,6 @@ void GameController::openGame(bool biosOnly) {
m_threadContext.sync.videoFrameWait = m_videoSync;
m_threadContext.sync.audioWait = m_audioSync;
}
if (!biosOnly) {
m_threadContext.core = mCoreFind(m_fname.toUtf8().constData());
} else {
m_threadContext.core = GBACoreCreate();
}
m_threadContext.core->init(m_threadContext.core);
unsigned width, height;