Replace all exit() with SWIG_exit()

For consistent cleanup on error
This commit is contained in:
William S Fulton 2019-07-29 19:35:54 +01:00
commit 2cf075558c
11 changed files with 24 additions and 24 deletions

View file

@ -1223,7 +1223,7 @@ public:
/* FIXME: How should this be handled? The rest of SWIG just seems
* to not bother checking for malloc failing! */
fprintf(stderr, "Malloc failed!\n");
exit(1);
SWIG_exit(EXIT_FAILURE);
}
for (i = 0; i < max_num_of_arguments; ++i) {
arg_names[i] = NULL;
@ -1235,7 +1235,7 @@ public:
/* FIXME: How should this be handled? The rest of SWIG just seems
* to not bother checking for malloc failing! */
fprintf(stderr, "Malloc failed!\n");
exit(1);
SWIG_exit(EXIT_FAILURE);
}
for (i = 0; i < max_num_of_arguments; ++i) {
arg_values[i] = NULL;