freemyipod r686 - Code Review

Jump to: navigation, search
Repository:freemyipod
Revision:r685‎ | r686 | r687 >
Date:22:46, 30 March 2011
Author:theseven
Status:new
Tags:
Comment:
libui: Fix chooser mutex not being unlocked before being destroyed
Modified paths:
  • /libs/ui/chooser.c (modified) (history)

Diff [purge]

Index: libs/ui/chooser.c
@@ -94,7 +94,6 @@
9595 if (data.finished) goto finished;
9696 redrawneeded |= data.redrawneeded;
9797 data.redrawneeded = false;
98 - mutex_unlock(&data.statemutex);
9998 if ((long)(lasttick + info->tickinterval - USEC_TIMER) < 0)
10099 {
101100 if (info->actionhandler->handletick)
@@ -110,6 +109,7 @@
111110 }
112111 lasttick = USEC_TIMER;
113112 }
 113+ mutex_unlock(&data.statemutex);
114114 if (redrawneeded) redrawneeded = info->renderer->render(&data) == CHOOSER_RESULT_REDRAW;
115115 }
116116 cancel:
@@ -116,6 +116,7 @@
117117 data.selected = NULL;
118118 finished:
119119 rc = data.selected;
 120+ mutex_unlock(&data.statemutex);
120121 destroy_buttonhook:
121122 button_unregister_handler(hook);
122123 destroy_renderer: