From 9852b6ac5eea101aa71d80b01a41d46cb4add5d1 Mon Sep 17 00:00:00 2001 From: Haru Date: Sun, 24 Jun 2018 02:26:58 +0200 Subject: Call the shutdown callback when terminating through the server exit console command Signed-off-by: Haru --- src/common/console.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/common/console.c b/src/common/console.c index 0b0a900f6..e7edd7e1e 100644 --- a/src/common/console.c +++ b/src/common/console.c @@ -133,7 +133,10 @@ int console_parse_key_pressed(void) **/ CPCMD_C(exit, server) { - core->runflag = 0; + if (core->shutdown_callback != NULL) + core->shutdown_callback(); + else + core->runflag = CORE_ST_STOP; } /** -- cgit v1.2.3-70-g09d2