framework/task_manager: Add state update logic before getinfo
Sometimes task state is not updated instantly. So before getting task information, task state should be updated.
i.e. Normal termination of task will not update the task state itself.
@@ -728,6 +728,12 @@ static int taskmgr_get_task_info(tm_appinfo_list_t **data, int handle)
int name_len = 0;
tm_appinfo_list_t *item;
const char *name;
+ int ret;
+
+ ret = taskmgr_get_task_state(handle);
+ if (ret == TM_APP_STATE_UNREGISTERED) {
+ return -ret;
+ }
item = (tm_appinfo_list_t *)TM_ALLOC(sizeof(tm_appinfo_list_t));
if (item == NULL) {
