summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--apps/misc.c1
-rw-r--r--firmware/target/hosted/sdl/button-sdl.c1
-rw-r--r--firmware/target/hosted/sdl/thread-sdl.c7
3 files changed, 6 insertions, 3 deletions
diff --git a/apps/misc.c b/apps/misc.c
index 3dfc2892ca..95c0dd6e34 100644
--- a/apps/misc.c
+++ b/apps/misc.c
@@ -256,7 +256,6 @@ static bool clean_shutdown(void (*callback)(void *), void *parameter)
256 (void)parameter; 256 (void)parameter;
257 bookmark_autobookmark(false); 257 bookmark_autobookmark(false);
258 call_storage_idle_notifys(true); 258 call_storage_idle_notifys(true);
259 exit(0);
260#else 259#else
261 long msg_id = -1; 260 long msg_id = -1;
262 int i; 261 int i;
diff --git a/firmware/target/hosted/sdl/button-sdl.c b/firmware/target/hosted/sdl/button-sdl.c
index 629d3aa9bd..e9fc03792c 100644
--- a/firmware/target/hosted/sdl/button-sdl.c
+++ b/firmware/target/hosted/sdl/button-sdl.c
@@ -176,7 +176,6 @@ void gui_message_loop(void)
176 case SDL_QUIT: 176 case SDL_QUIT:
177 { 177 {
178 sim_exit_irq_handler(); 178 sim_exit_irq_handler();
179 SDL_Quit();
180 exit(EXIT_SUCCESS); 179 exit(EXIT_SUCCESS);
181 break; 180 break;
182 } 181 }
diff --git a/firmware/target/hosted/sdl/thread-sdl.c b/firmware/target/hosted/sdl/thread-sdl.c
index 28a9cb8d3a..da43d6ea9f 100644
--- a/firmware/target/hosted/sdl/thread-sdl.c
+++ b/firmware/target/hosted/sdl/thread-sdl.c
@@ -566,7 +566,12 @@ void remove_thread(unsigned int thread_id)
566 566
567void thread_exit(void) 567void thread_exit(void)
568{ 568{
569 remove_thread(THREAD_ID_CURRENT); 569 struct thread_entry *t = thread_id_entry(THREAD_ID_CURRENT);
570 /* the main thread cannot be removed since it's created implicitely
571 * by starting the program;
572 * it has no valid jumpbuf to exit, do nothing for now */
573 if (t != &threads[0])
574 remove_thread(t->id);
570} 575}
571 576
572void thread_wait(unsigned int thread_id) 577void thread_wait(unsigned int thread_id)