Pass thread exit code from app thread as process exit code. Issue #430.

This commit is contained in:
Branimir Karadžić 2015-06-09 22:24:49 -07:00
parent ef143a1bb6
commit 6e6e16e2ba
3 changed files with 6 additions and 5 deletions

View file

@ -320,7 +320,7 @@ namespace entry
initTranslateGamepadAxis(SDL_CONTROLLER_AXIS_TRIGGERRIGHT, GamepadAxis::RightZ); initTranslateGamepadAxis(SDL_CONTROLLER_AXIS_TRIGGERRIGHT, GamepadAxis::RightZ);
} }
void run(int _argc, char** _argv) int run(int _argc, char** _argv)
{ {
m_mte.m_argc = _argc; m_mte.m_argc = _argc;
m_mte.m_argv = _argv; m_mte.m_argv = _argv;
@ -710,6 +710,8 @@ namespace entry
SDL_DestroyWindow(m_window[0]); SDL_DestroyWindow(m_window[0]);
SDL_Quit(); SDL_Quit();
return m_thread.getExitCode();
} }
WindowHandle findHandle(uint32_t _windowId) WindowHandle findHandle(uint32_t _windowId)
@ -896,8 +898,7 @@ namespace entry
int main(int _argc, char** _argv) int main(int _argc, char** _argv)
{ {
using namespace entry; using namespace entry;
s_ctx.run(_argc, _argv); return s_ctx.run(_argc, _argv);
return 0;
} }
#endif // ENTRY_CONFIG_USE_SDL #endif // ENTRY_CONFIG_USE_SDL

View file

@ -499,7 +499,7 @@ namespace entry
s_xinput.shutdown(); s_xinput.shutdown();
return 0; return thread.getExitCode();
} }
LRESULT process(HWND _hwnd, UINT _id, WPARAM _wparam, LPARAM _lparam) LRESULT process(HWND _hwnd, UINT _id, WPARAM _wparam, LPARAM _lparam)

View file

@ -477,7 +477,7 @@ namespace entry
XUnmapWindow(m_display, m_window[0]); XUnmapWindow(m_display, m_window[0]);
XDestroyWindow(m_display, m_window[0]); XDestroyWindow(m_display, m_window[0]);
return EXIT_SUCCESS; return thread.getExitCode();
} }
void setModifier(Modifier::Enum _modifier, bool _set) void setModifier(Modifier::Enum _modifier, bool _set)