freemyipod r567 - Code Review

Jump to: navigation, search
Repository:freemyipod
Revision:r566‎ | r567 | r568 >
Date:00:23, 8 February 2011
Author:theseven
Status:new
Tags:
Comment:
emCORE: Fix library_unload
Modified paths:
  • /emcore/trunk/library.c (modified) (history)

Diff [purge]

Index: emcore/trunk/library.c
@@ -83,6 +83,7 @@
8484 found = true;
8585 break;
8686 }
 87+ else prev = h;
8788 if (!found)
8889 {
8990 mutex_unlock(&library_mutex);
@@ -107,23 +108,16 @@
108109 return -3;
109110 }
110111 if (library_list_head == h) library_list_head = h->next;
111 - else
112 - for (h = library_list_head; h; h = h->next)
113 - if (h->next->lib == lib)
114 - {
115 - prev = h->next;
116 - h->next = h->next->next;
117 - break;
118 - }
119 - library_release_all_of_thread((struct scheduler_thread*)prev);
 112+ else prev->next = h->next;
 113+ library_release_all_of_thread((struct scheduler_thread*)h);
120114 #ifdef HAVE_STORAGE
121 - close_all_of_process((struct scheduler_thread*)prev);
122 - closedir_all_of_process((struct scheduler_thread*)prev);
 115+ close_all_of_process((struct scheduler_thread*)h);
 116+ closedir_all_of_process((struct scheduler_thread*)h);
123117 #endif
124118 #ifdef HAVE_BUTTON
125 - button_unregister_all_of_thread((struct scheduler_thread*)prev);
 119+ button_unregister_all_of_thread((struct scheduler_thread*)h);
126120 #endif
127 - free_all_of_thread((struct scheduler_thread*)prev);
 121+ free_all_of_thread((struct scheduler_thread*)h);
128122 mutex_unlock(&library_mutex);
129123 return 0;
130124 }