diff options
| author | Dan Engelbrecht <[email protected]> | 2023-05-11 16:54:16 +0200 |
|---|---|---|
| committer | GitHub <[email protected]> | 2023-05-11 16:54:16 +0200 |
| commit | 1250f1c71c3a734a7f04bc029516733f9e87ff27 (patch) | |
| tree | 0c61b42a409816219d0cc74b577fead9094efd35 /src/zencore | |
| parent | allow early logging (#292) (diff) | |
| download | zen-1250f1c71c3a734a7f04bc029516733f9e87ff27.tar.xz zen-1250f1c71c3a734a7f04bc029516733f9e87ff27.zip | |
Gracefully exit if Ctrl-C is pressed (#293)
* Feature: Gracefully exit if Ctrl-C is pressed
* Bugfix: Return error code on exit as set by application
* changelog
Diffstat (limited to 'src/zencore')
| -rw-r--r-- | src/zencore/include/zencore/zencore.h | 1 | ||||
| -rw-r--r-- | src/zencore/zencore.cpp | 6 |
2 files changed, 7 insertions, 0 deletions
diff --git a/src/zencore/include/zencore/zencore.h b/src/zencore/include/zencore/zencore.h index 5bcd77239..d4173e128 100644 --- a/src/zencore/include/zencore/zencore.h +++ b/src/zencore/include/zencore/zencore.h @@ -329,6 +329,7 @@ namespace zen { ZENCORE_API bool IsApplicationExitRequested(); ZENCORE_API void RequestApplicationExit(int ExitCode); +ZENCORE_API int ApplicationExitCode(); ZENCORE_API bool IsDebuggerPresent(); ZENCORE_API void SetIsInteractiveSession(bool Value); ZENCORE_API bool IsInteractiveSession(); diff --git a/src/zencore/zencore.cpp b/src/zencore/zencore.cpp index 96d61a0ab..ae3d3934d 100644 --- a/src/zencore/zencore.cpp +++ b/src/zencore/zencore.cpp @@ -99,6 +99,12 @@ RequestApplicationExit(int ExitCode) s_ApplicationExitRequested = true; } +int +ApplicationExitCode() +{ + return s_ApplicationExitCode; +} + #if ZEN_WITH_TESTS void zencore_forcelinktests() |