From e1a69e3fc5fbe460580e290392c036604155c7ee Mon Sep 17 00:00:00 2001 From: Holger Vogt Date: Sat, 25 Apr 2020 20:22:40 +0200 Subject: [PATCH] controlled_exit only for WinGUI and shared ngspice --- src/misc/alloc.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/misc/alloc.c b/src/misc/alloc.c index 2d021e091..a8aa8640f 100644 --- a/src/misc/alloc.c +++ b/src/misc/alloc.c @@ -185,7 +185,11 @@ static void overflow_error(size_t num, size_t size) (void) fprintf(stderr, "Cannot allocate %zu X %zu bytes: " "Product exceeds largest size_t = %zu.\n", num, size, SIZE_MAX); +#if defined HAS_WINGUI || defined SHARED_MODULE controlled_exit(EXIT_FAILURE); +#else + exit(EXIT_FAILURE); +#endif } /* end of function overflow_error */ #endif /* #ifndef HAVE_LIBGC */