comparison ALmixer.c @ 16:038baa026db3

Fixed bug in LinkedList delete. Shouldn't have both popped list and then called FreeData which would check the list again for the data. Instead, I should just get the data and then call FreeData to let it manipulate the list.
author Eric Wing <ewing . public |-at-| gmail . com>
date Sat, 06 Nov 2010 03:59:28 -0700
parents 54aa96ae8912
children 9365e714fc4b 58f03008ea05
comparison
equal deleted inserted replaced
15:b27f7ff5e44b 16:038baa026db3
7169 /* Delete the list of ALmixerData's before Sound_Quit deletes 7169 /* Delete the list of ALmixerData's before Sound_Quit deletes
7170 * its own underlying information and I potentially have dangling pointers. 7170 * its own underlying information and I potentially have dangling pointers.
7171 */ 7171 */
7172 while(LinkedList_Size(s_listOfALmixerData) > 0) 7172 while(LinkedList_Size(s_listOfALmixerData) > 0)
7173 { 7173 {
7174 ALmixer_Data* almixer_data = LinkedList_PopBack(s_listOfALmixerData); 7174 /* Note that ALmixer_FreeData will remove the data from the linked list for us so don't pop the list here. */
7175 ALmixer_Data* almixer_data = LinkedList_Back(s_listOfALmixerData);
7175 ALmixer_FreeData(almixer_data); 7176 ALmixer_FreeData(almixer_data);
7176 } 7177 }
7177 LinkedList_Free(s_listOfALmixerData); 7178 LinkedList_Free(s_listOfALmixerData);
7178 s_listOfALmixerData = NULL; 7179 s_listOfALmixerData = NULL;
7179 7180