AP_Common: add AP_ExpandingArray delete

This commit is contained in:
Randy Mackay 2019-06-19 08:24:35 +09:00
parent 578023483c
commit 4ef3005d2c

View File

@ -47,6 +47,16 @@ public:
chunk_size(elements_per_chunk)
{}
~AP_ExpandingArray(void)
{
// free chunks
for (uint16_t i=0; i<chunk_count; i++) {
free(chunk_ptrs[i]);
}
// free chunks_ptrs array
free(chunk_ptrs);
}
/* Do not allow copies */
AP_ExpandingArray<T>(const AP_ExpandingArray<T> &other) = delete;
AP_ExpandingArray<T> &operator=(const AP_ExpandingArray<T>&) = delete;