From: Hyotaek Shim Date: Tue, 6 Aug 2019 02:20:13 +0000 (+0900) Subject: Fix exit sequence X-Git-Tag: accepted/tizen/unified/20190816.112336~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=bfe584cfafd9b71222789a03cfebce80ef09d4f9;p=platform%2Fcore%2Fsystem%2Ffeedbackd.git Fix exit sequence root@localhost:~# systemctl stop feedbackd.service root@localhost:~# systemctl status feedbackd * feedbackd.service - System Vibrator Daemon Loaded: loaded (/usr/lib/systemd/system/feedbackd.service; disabled; vendor preset: enabled) Active: inactive (dead) since Mon 2018-08-13 08:11:48 KST; 4s ago Process: 804 ExecStart=/usr/bin/feedbackd (code=exited, status=0/SUCCESS) Main PID: 804 (code=exited, status=0/SUCCESS) Aug 13 08:11:47 localhost systemd[1]: Stopping System Vibrator Daemon... Aug 13 08:11:48 localhost feedbackd[804]: g_main_loop_unref: assertion 'loop != NULL' failed Aug 13 08:11:48 localhost systemd[1]: Stopped System Vibrator Daemon. Warning: Journal has been rotated since unit was started. Log output is incomplete or unavailable. Change-Id: I24178f135688a8cb5cec55c602baf79853ed37cb Signed-off-by: Hyotaek Shim --- diff --git a/src/core/main.c b/src/core/main.c index 3134e63..03d1169 100644 --- a/src/core/main.c +++ b/src/core/main.c @@ -42,7 +42,6 @@ static void sig_usr1(int signo) if (mainloop) { if (g_main_loop_is_running(mainloop)) g_main_loop_quit(mainloop); - mainloop = NULL; } } @@ -84,8 +83,11 @@ int main(int argc, char **argv) _D("'Haptic' deinitialize."); haptic_exit(); - g_main_loop_unref(mainloop); - mainloop = NULL; + + if (mainloop) { + g_main_loop_unref(mainloop); + mainloop = NULL; + } return 0; }