Fix input handler cleanup on startup failure
This commit is contained in:
parent
561eed4cbd
commit
2c09875556
1 changed files with 10 additions and 0 deletions
|
|
@ -862,10 +862,14 @@ void Session::exec(int displayOriginX, int displayOriginY)
|
||||||
m_InputHandler->getAttachedGamepadMask());
|
m_InputHandler->getAttachedGamepadMask());
|
||||||
}
|
}
|
||||||
} catch (const GfeHttpResponseException& e) {
|
} catch (const GfeHttpResponseException& e) {
|
||||||
|
delete m_InputHandler;
|
||||||
|
m_InputHandler = nullptr;
|
||||||
emit displayLaunchError(e.toQString());
|
emit displayLaunchError(e.toQString());
|
||||||
QThreadPool::globalInstance()->start(new DeferredSessionCleanupTask(this));
|
QThreadPool::globalInstance()->start(new DeferredSessionCleanupTask(this));
|
||||||
return;
|
return;
|
||||||
} catch (const QtNetworkReplyException& e) {
|
} catch (const QtNetworkReplyException& e) {
|
||||||
|
delete m_InputHandler;
|
||||||
|
m_InputHandler = nullptr;
|
||||||
emit displayLaunchError(e.toQString());
|
emit displayLaunchError(e.toQString());
|
||||||
QThreadPool::globalInstance()->start(new DeferredSessionCleanupTask(this));
|
QThreadPool::globalInstance()->start(new DeferredSessionCleanupTask(this));
|
||||||
return;
|
return;
|
||||||
|
|
@ -876,6 +880,8 @@ void Session::exec(int displayOriginX, int displayOriginY)
|
||||||
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION,
|
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION,
|
||||||
"SDL_InitSubSystem(SDL_INIT_VIDEO) failed: %s",
|
"SDL_InitSubSystem(SDL_INIT_VIDEO) failed: %s",
|
||||||
SDL_GetError());
|
SDL_GetError());
|
||||||
|
delete m_InputHandler;
|
||||||
|
m_InputHandler = nullptr;
|
||||||
emit displayLaunchError(QString::fromLocal8Bit(SDL_GetError()));
|
emit displayLaunchError(QString::fromLocal8Bit(SDL_GetError()));
|
||||||
QThreadPool::globalInstance()->start(new DeferredSessionCleanupTask(this));
|
QThreadPool::globalInstance()->start(new DeferredSessionCleanupTask(this));
|
||||||
return;
|
return;
|
||||||
|
|
@ -904,6 +910,8 @@ void Session::exec(int displayOriginX, int displayOriginY)
|
||||||
if (err != 0) {
|
if (err != 0) {
|
||||||
// We already displayed an error dialog in the stage failure
|
// We already displayed an error dialog in the stage failure
|
||||||
// listener.
|
// listener.
|
||||||
|
delete m_InputHandler;
|
||||||
|
m_InputHandler = nullptr;
|
||||||
SDL_QuitSubSystem(SDL_INIT_VIDEO);
|
SDL_QuitSubSystem(SDL_INIT_VIDEO);
|
||||||
QThreadPool::globalInstance()->start(new DeferredSessionCleanupTask(this));
|
QThreadPool::globalInstance()->start(new DeferredSessionCleanupTask(this));
|
||||||
return;
|
return;
|
||||||
|
|
@ -926,6 +934,8 @@ void Session::exec(int displayOriginX, int displayOriginY)
|
||||||
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION,
|
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION,
|
||||||
"SDL_CreateWindow() failed: %s",
|
"SDL_CreateWindow() failed: %s",
|
||||||
SDL_GetError());
|
SDL_GetError());
|
||||||
|
delete m_InputHandler;
|
||||||
|
m_InputHandler = nullptr;
|
||||||
SDL_QuitSubSystem(SDL_INIT_VIDEO);
|
SDL_QuitSubSystem(SDL_INIT_VIDEO);
|
||||||
QThreadPool::globalInstance()->start(new DeferredSessionCleanupTask(this));
|
QThreadPool::globalInstance()->start(new DeferredSessionCleanupTask(this));
|
||||||
return;
|
return;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue