mirror of
				https://github.com/raysan5/raylib.git
				synced 2025-10-26 12:27:01 +00:00 
			
		
		
		
	fix various memory leaks (#1969)
This commit is contained in:
		| @@ -276,7 +276,10 @@ static void __InsertMemNode(MemPool *const mempool, AllocList *const list, MemNo | ||||
|                 mempool->arena.offs += iter->size; | ||||
|                 __RemoveMemNode(list, iter); | ||||
|                 iter = list->head; | ||||
|                 if (iter == NULL) return; | ||||
|                 if (iter == NULL) { | ||||
|                     list->head = node;     | ||||
|                     return; | ||||
|                 } | ||||
|             } | ||||
|             const uintptr_t inode = ( uintptr_t )node; | ||||
|             const uintptr_t iiter = ( uintptr_t )iter; | ||||
| @@ -293,6 +296,14 @@ static void __InsertMemNode(MemPool *const mempool, AllocList *const list, MemNo | ||||
|                     iter->size += node->size; | ||||
|                     return; | ||||
|                 } | ||||
|                 else if (iter->next == NULL) | ||||
|                 { | ||||
|                     // we reached the end of the free list -> append the node | ||||
|                     iter->next = node; | ||||
|                     node->prev = iter; | ||||
|                     list->len++; | ||||
|                     return;     | ||||
|                 } | ||||
|             } | ||||
|             else if (iter > node) | ||||
|             { | ||||
| @@ -326,7 +337,7 @@ static void __InsertMemNode(MemPool *const mempool, AllocList *const list, MemNo | ||||
|                 } | ||||
|                 else | ||||
|                 { | ||||
|                     __InsertMemNodeBefore(list, iter, node); | ||||
|                     __InsertMemNodeBefore(list, node, iter); | ||||
|                     list->len++; | ||||
|                     return; | ||||
|                 } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 atticus
					atticus