Fix leaky pools.

This commit is contained in:
Michael Jumper 2012-11-29 20:02:58 -08:00
parent 3e209e1983
commit 825e3da0a2

View File

@ -59,7 +59,20 @@ guac_pool* guac_pool_alloc(int size) {
} }
void guac_pool_free(guac_pool* pool) { void guac_pool_free(guac_pool* pool) {
/* Free all ints in pool */
guac_pool_int* current = pool->__head;
while (current != NULL) {
guac_pool_int* old = current;
current = current->__next;
free(old);
}
/* Free pool */
free(pool); free(pool);
} }
int guac_pool_next_int(guac_pool* pool) { int guac_pool_next_int(guac_pool* pool) {