Delete the whole linked list (omg noob?).
This commit is contained in:
		
							parent
							
								
									c6ac149dde
								
							
						
					
					
						commit
						6c5970da62
					
				| @ -29,10 +29,16 @@ void initialize_stack(struct stack *stack) { | ||||
| } | ||||
| 
 | ||||
| void delete_stack(struct stack *stack) { | ||||
|   struct stack *tmp_stack; | ||||
| 
 | ||||
|   if (stack) { | ||||
|     while (stack) { | ||||
|       tmp_stack = stack->next; | ||||
|       delete_card(stack->card); | ||||
|   } | ||||
|       free(stack); | ||||
|       stack = tmp_stack; | ||||
|     } | ||||
|   } | ||||
| 
 | ||||
|   return; | ||||
| } | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user