From 6a907c89a3e6a3d454c3bc7673571861f1ca4852 Mon Sep 17 00:00:00 2001 From: Ginger Bill Date: Wed, 18 Nov 2015 12:18:33 +0000 Subject: [PATCH] Fix array::free --- README.md | 2 +- gb.hpp | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 91e0818..528a5fd 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ gb single-file public domain libraries for C & C++ library | latest version | category | languages | description ----------------|----------------|----------|-----------|------------- **gb_string.h** | 0.93 | strings | C, C++ | A better string library for C & C++ -**gb.hpp** | 0.21c | misc | C++11 | (Experimental) A C++11 helper library without STL geared towards game development +**gb.hpp** | 0.21d | misc | C++11 | (Experimental) A C++11 helper library without STL geared towards game development **gb_math.hpp** | 0.02b | math | C++11 | A C++11 math library geared towards game development **gb_ini.h** | 0.91 | misc | C, C++ | A simple ini file loader library for C & C++ diff --git a/gb.hpp b/gb.hpp index 1be1be6..40b4de9 100644 --- a/gb.hpp +++ b/gb.hpp @@ -1,8 +1,9 @@ -// gb.hpp - v0.21c - public domain C++11 helper library - no warranty implied; use at your own risk +// gb.hpp - v0.21d - public domain C++11 helper library - no warranty implied; use at your own risk // (Experimental) A C++11 helper library without STL geared towards game development /* Version History: + 0.21d - Fix array::free 0.21c - Fix Another Typo causing unresolved external symbol 0.21b - Typo fixes 0.21a - Better `static` keywords @@ -1329,6 +1330,9 @@ free(Array* a) { if (a->allocator) dealloc(a->allocator, a->data); + a->count = 0; + a->capacity = 0; + a->data = nullptr; } template