From 9965a4a3a62f7707416fdd3b12003e643f25e055 Mon Sep 17 00:00:00 2001 From: Geoffrey McRae Date: Thu, 21 Jan 2021 16:27:57 +1100 Subject: [PATCH] [host] app: prevent double call to stopThreads --- host/src/app.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/host/src/app.c b/host/src/app.c index 3668fc9e..72e8cd45 100644 --- a/host/src/app.c +++ b/host/src/app.c @@ -599,7 +599,8 @@ int app_main(int argc, char * argv[]) if (!captureRestart()) { exitcode = LG_HOST_EXIT_FAILED; - goto finish; + stopThreads(); + goto fail_capture; } app.state = APP_STATE_RUNNING; } @@ -626,20 +627,18 @@ int app_main(int argc, char * argv[]) case CAPTURE_RESULT_ERROR: DEBUG_ERROR("Capture interface reported a fatal error"); exitcode = LG_HOST_EXIT_FAILED; - goto finish; + goto fail_capture; } } if (app.state != APP_STATE_SHUTDOWN) DEBUG_INFO("No subscribers, going to sleep..."); + captureStop(); } exitcode = app.exitcode; -finish: - stopThreads(); - fail_capture: lgTimerDestroy(app.lgmpTimer);