Skip to content

Commit

Permalink
Added "abort()" handler for Windows build.
Browse files Browse the repository at this point in the history
  • Loading branch information
gildor2 committed Apr 21, 2017
1 parent 305208b commit 0d2f166
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions UmodelTool/Main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

#if _WIN32
#include <direct.h> // getcwd
#include <signal.h> // abort handler
#else
#include <unistd.h> // getcwd
#endif
Expand Down Expand Up @@ -668,6 +669,13 @@ static void ExceptionHandler()
exit(1);
}

#if _WIN32
// AbortHandler on linux will cause infinite recurse, but works well on Windows
static void AbortHandler(int signal)
{
appError("abort() called");
}
#endif

#if UNREAL4

Expand Down Expand Up @@ -696,6 +704,10 @@ int main(int argc, char **argv)
TRY {
#endif

#if _WIN32
signal(SIGABRT, AbortHandler);
#endif

guard(Main);

// display usage
Expand Down

0 comments on commit 0d2f166

Please sign in to comment.