comparison th_util.c @ 307:a6304a3719ee

Free every item in the ringbuffer instead of just up to N.
author Matti Hamalainen <ccr@tnsp.org>
date Sat, 11 Jun 2011 05:46:29 +0300
parents 21528fe535fb
children
comparison
equal deleted inserted replaced
306:21528fe535fb 307:a6304a3719ee
426 426
427 void th_ringbuf_free(qringbuf_t *buf) 427 void th_ringbuf_free(qringbuf_t *buf)
428 { 428 {
429 int i; 429 int i;
430 430
431 for (i = 0; i < buf->n; i++) 431 for (i = 0; i < buf->size; i++)
432 if (buf->data[i] != NULL) 432 if (buf->data[i] != NULL)
433 buf->deallocator(buf->data[i]); 433 buf->deallocator(buf->data[i]);
434 434
435 th_free(buf->data); 435 th_free(buf->data);
436 th_free(buf); 436 th_free(buf);