# HG changeset patch # User Matti Hamalainen # Date 1670364405 -7200 # Node ID 1a3ea8f7bb354afc2d6e706730882d5fe7688e44 # Parent ef1521b179b194ef9ae98f2aa1f76d96a83d6a1d Use specified deallocator for ringbuffers when rotating. diff -r ef1521b179b1 -r 1a3ea8f7bb35 th_datastruct.c --- a/th_datastruct.c Fri Feb 25 15:25:16 2022 +0200 +++ b/th_datastruct.c Wed Dec 07 00:06:45 2022 +0200 @@ -344,8 +344,7 @@ { for (size_t i = 0; i < buf->size; i++) { - if (buf->data[i] != NULL) - buf->deallocator(buf->data[i]); + buf->deallocator(buf->data[i]); } th_free(buf->data); @@ -360,7 +359,7 @@ if (buf->n < buf->size) buf->n++; - th_free(buf->data[0]); + buf->deallocator(buf->data[0]); memmove(&(buf->data[0]), &(buf->data[1]), (buf->size - 1) * sizeof(void *)); buf->data[buf->size - 1] = ptr; }