--- libelwix/src/array.c 2019/01/23 17:34:41 1.8.4.1 +++ libelwix/src/array.c 2019/01/23 18:22:41 1.9 @@ -3,7 +3,7 @@ * by Michael Pounov * * $Author: misho $ -* $Id: array.c,v 1.8.4.1 2019/01/23 17:34:41 misho Exp $ +* $Id: array.c,v 1.9 2019/01/23 18:22:41 misho Exp $ * ************************************************************************** The ELWIX and AITNET software is distributed under the following @@ -200,10 +200,26 @@ array_Destroy(array_t ** __restrict parr) } /* + * array_Destroy2() - Free data in dynamic array + * + * @parr = Array + * return: none + */ +void +array_Destroy2(array_t * __restrict arr) +{ + if (!arr) + return; + + if (arr->arr_data) + e_free(arr->arr_data); + memset(arr, 0, sizeof(array_t)); +} +/* * array_Reset() - Reset array to initial state * * @parr = Array - * @purge = Purge data, if <>0 then will be free entire data memory + * @purge = Purge all data, if <>0 then will be free entire data memory * return: none */ void