Tidy up sp_shutdown with Cider.

This commit is contained in:
Brian Taylor 2023-07-03 16:19:13 -07:00 committed by Holger Vogt
parent b63f6e7905
commit f3b83fd4e4
1 changed files with 9 additions and 6 deletions

View File

@ -536,15 +536,18 @@ sp_shutdown(int exitval)
#ifdef CIDER #ifdef CIDER
{ {
extern int IsCiderLoaded(void); extern int IsCiderLoaded(void);
char *cider_quit = getenv("CIDER_COM_QUIT"); char *cider_quit_s = NULL;
bool cider_com_quit = TRUE; bool cider_com_quit = TRUE;
if (cider_quit && eq(cider_quit, "OFF")) { if (exitval != EXIT_BAD) {
cider_quit_s = getenv("CIDER_COM_QUIT");
if (cider_quit_s && *cider_quit_s && eq(cider_quit_s, "OFF")) {
cider_com_quit = FALSE; cider_com_quit = FALSE;
} }
if (cider_com_quit && IsCiderLoaded() > 0) { if (cider_com_quit && IsCiderLoaded() > 0) {
com_quit(NULL); com_quit(NULL);
} }
} }
}
#endif #endif
destroy_ivars(); destroy_ivars();
#ifdef HAS_WINGUI #ifdef HAS_WINGUI