Dolphin: fix archive double start crash (#659)

This commit is contained in:
あく 2021-08-18 18:06:55 +03:00 committed by GitHub
parent 274e9e8576
commit d04deb48b8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -10,9 +10,15 @@ static void dolphin_switch_to_app(Dolphin* dolphin, const FlipperApplication* fl
furi_assert(flipper_app->app); furi_assert(flipper_app->app);
furi_assert(flipper_app->name); 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_name(dolphin->scene_thread, flipper_app->name);
furi_thread_set_stack_size(dolphin->scene_thread, flipper_app->stack_size); furi_thread_set_stack_size(dolphin->scene_thread, flipper_app->stack_size);
furi_thread_set_callback(dolphin->scene_thread, flipper_app->app); furi_thread_set_callback(dolphin->scene_thread, flipper_app->app);
furi_thread_start(dolphin->scene_thread); furi_thread_start(dolphin->scene_thread);
} }