menu_widgets: fix crash with tasks

This commit is contained in:
natinusala 2019-07-24 19:30:17 +02:00
parent 5047d6e709
commit 73ff5334c5
2 changed files with 28 additions and 20 deletions

View File

@ -476,7 +476,7 @@ bool menu_widgets_msg_queue_push(
menu_animation_ctx_entry_t entry; menu_animation_ctx_entry_t entry;
entry.easing_enum = EASING_OUT_QUAD; entry.easing_enum = EASING_OUT_QUAD;
entry.tag = (uintptr_t) NULL; entry.tag = (uintptr_t) msg_widget;
entry.duration = MSG_QUEUE_ANIMATION_DURATION*2; entry.duration = MSG_QUEUE_ANIMATION_DURATION*2;
entry.target_value = msg_queue_height/2.0f; entry.target_value = msg_queue_height/2.0f;
entry.subject = &msg_widget->msg_transition_animation; entry.subject = &msg_widget->msg_transition_animation;
@ -525,7 +525,7 @@ static void menu_widgets_move_end(void *userdata)
entry.duration = MSG_QUEUE_ANIMATION_DURATION; entry.duration = MSG_QUEUE_ANIMATION_DURATION;
entry.easing_enum = EASING_OUT_QUAD; entry.easing_enum = EASING_OUT_QUAD;
entry.subject = &unfold->unfold; entry.subject = &unfold->unfold;
entry.tag = generic_tag; entry.tag = (uintptr_t) unfold;
entry.target_value = 1.0f; entry.target_value = 1.0f;
entry.userdata = unfold; entry.userdata = unfold;
@ -577,7 +577,7 @@ static void menu_widgets_msg_queue_move(void)
entry.duration = MSG_QUEUE_ANIMATION_DURATION; entry.duration = MSG_QUEUE_ANIMATION_DURATION;
entry.easing_enum = EASING_OUT_QUAD; entry.easing_enum = EASING_OUT_QUAD;
entry.subject = &msg->offset_y; entry.subject = &msg->offset_y;
entry.tag = generic_tag; entry.tag = (uintptr_t) msg;
entry.target_value = y; entry.target_value = y;
entry.userdata = unfold; entry.userdata = unfold;
@ -609,6 +609,10 @@ static void menu_widgets_msg_queue_free(menu_widget_msg_t *msg, bool touch_list)
menu_timer_kill(&msg->hourglass_timer); menu_timer_kill(&msg->hourglass_timer);
menu_animation_kill_by_tag(&tag); menu_animation_kill_by_tag(&tag);
/* Kill all timers */
if (msg->expiration_timer_started)
menu_timer_kill(&msg->expiration_timer);
/* Free it */ /* Free it */
if (msg->msg) if (msg->msg)
free(msg->msg); free(msg->msg);
@ -657,7 +661,7 @@ static void menu_widgets_msg_queue_kill(unsigned idx)
entry.cb = NULL; entry.cb = NULL;
entry.duration = MSG_QUEUE_ANIMATION_DURATION; entry.duration = MSG_QUEUE_ANIMATION_DURATION;
entry.easing_enum = EASING_OUT_QUAD; entry.easing_enum = EASING_OUT_QUAD;
entry.tag = generic_tag; entry.tag = (uintptr_t) msg;
entry.userdata = NULL; entry.userdata = NULL;
entry.subject = &msg->offset_y; entry.subject = &msg->offset_y;
entry.target_value = msg->offset_y - msg_queue_height/4; entry.target_value = msg->offset_y - msg_queue_height/4;
@ -1933,6 +1937,7 @@ static void menu_widgets_achievement_free(void *userdata)
void menu_widgets_free(void) void menu_widgets_free(void)
{ {
size_t i; size_t i;
menu_animation_ctx_tag libretro_tag;
if (!menu_widgets_inited) if (!menu_widgets_inited)
return; return;
@ -1990,7 +1995,10 @@ void menu_widgets_free(void)
generic_message_alpha = 0.0f; generic_message_alpha = 0.0f;
/* Libretro message */ /* Libretro message */
libretro_tag = (uintptr_t) &libretro_message_timer;
libretro_message_alpha = 0.0f; libretro_message_alpha = 0.0f;
menu_timer_kill(&libretro_message_timer);
menu_animation_kill_by_tag(&libretro_tag);
/* Volume */ /* Volume */
volume_alpha = 0.0f; volume_alpha = 0.0f;
@ -2174,7 +2182,7 @@ void menu_widgets_start_load_content_animation(const char *content_name, bool re
/* Setup the animation */ /* Setup the animation */
entry.cb = NULL; entry.cb = NULL;
entry.easing_enum = EASING_OUT_QUAD; entry.easing_enum = EASING_OUT_QUAD;
entry.tag = (uintptr_t) NULL; entry.tag = generic_tag;
entry.userdata = NULL; entry.userdata = NULL;
/* Stage one: icon animation */ /* Stage one: icon animation */