diff options
Diffstat (limited to 'backend/util.hpp')
-rw-r--r-- | backend/util.hpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/backend/util.hpp b/backend/util.hpp new file mode 100644 index 0000000..2d9e76a --- /dev/null +++ b/backend/util.hpp @@ -0,0 +1,11 @@ +#pragma once + +#include "util.h" + +template <typename T> +void safe_free(List<T *> & ptr_list) { + for (T * obj : ptr_list) + delete obj; + ptr_list.clear(); +} + |