From d04deb48b8f740e1c7c54cd241813308ac2ff9d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=81=82=E3=81=8F?= Date: Wed, 18 Aug 2021 18:06:55 +0300 Subject: [PATCH] Dolphin: fix archive double start crash (#659) --- applications/dolphin/dolphin.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/applications/dolphin/dolphin.c b/applications/dolphin/dolphin.c index 51eed34b..cdcef27e 100644 --- a/applications/dolphin/dolphin.c +++ b/applications/dolphin/dolphin.c @@ -10,9 +10,15 @@ static void dolphin_switch_to_app(Dolphin* dolphin, const FlipperApplication* fl furi_assert(flipper_app->app); furi_assert(flipper_app->name); + if(furi_thread_get_state(dolphin->scene_thread) != FuriThreadStateStopped) { + FURI_LOG_E("Dolphin", "Thread is already running"); + return; + } + furi_thread_set_name(dolphin->scene_thread, flipper_app->name); furi_thread_set_stack_size(dolphin->scene_thread, flipper_app->stack_size); furi_thread_set_callback(dolphin->scene_thread, flipper_app->app); + furi_thread_start(dolphin->scene_thread); }