diff options
author | ConfuSomu | 2021-08-11 12:46:07 -0400 |
---|---|---|
committer | ConfuSomu | 2021-08-11 12:46:07 -0400 |
commit | d42b7faba24cdb14c556762200d586093570b2e5 (patch) | |
tree | 426bd064ac27813c7a197df20850d888bd5bc537 | |
parent | e633a2f0d34541dfd86c4dd6652aaab241b1a752 (diff) | |
download | pico-watch-d42b7faba24cdb14c556762200d586093570b2e5.tar pico-watch-d42b7faba24cdb14c556762200d586093570b2e5.tar.gz pico-watch-d42b7faba24cdb14c556762200d586093570b2e5.zip |
Remove one check used to see if app is already init
There is already another check done in app_mgr::app_init(). Checking
also in app_mgr::app_switch() is redundant. I am not sure if the
verification should instead be done in app_switch(). I can move it
later if required.
-rw-r--r-- | app_manager.cpp | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/app_manager.cpp b/app_manager.cpp index 8fe5cb2..34d4b32 100644 --- a/app_manager.cpp +++ b/app_manager.cpp @@ -52,6 +52,8 @@ BaseApp* app_mgr::app_init(int app_id) { return app_init(0); } + // Check if the app is already running. + // Should this be done instead in app_mgr::app_switch() ? auto app_ptr = app_check_if_init(app_id); if (app_ptr) new_app = app_ptr; @@ -100,11 +102,6 @@ void app_mgr::app_switch(BaseApp* app, int new_appid) { if (app->app_get_attributes().destroy_on_exit) app_destroy(app); - auto app_ptr = app_check_if_init(new_appid); - if (app_ptr) - g_s.foreground_app = app_ptr; - else - g_s.foreground_app = app_init(new_appid); - + g_s.foreground_app = app_init(new_appid); g_s.app_ready = true; } |