]> git.xonotic.org Git - xonotic/gmqcc.git/commitdiff
a vector_remove shouldn't clear the vector when failing to reallocate as a smaller...
authorWolfgang (Blub) Bumiller <blub@speed.at>
Fri, 27 Apr 2012 11:53:49 +0000 (13:53 +0200)
committerWolfgang (Blub) Bumiller <blub@speed.at>
Fri, 27 Apr 2012 11:54:00 +0000 (13:54 +0200)
astir.h

diff --git a/astir.h b/astir.h
index 09b9843492c37cc424a801339742c816d34b18b5..37f7627b93de6d3c6b45e6879a3252e91ea68a3d 100644 (file)
--- a/astir.h
+++ b/astir.h
@@ -73,10 +73,8 @@ bool GMQCC_WARN Tself##_##mem##_remove(Tself *self, size_t idx)      \
     {                                                                \
         self->mem##_alloc /= 2;                                      \
         reall = (Twhat*)mem_a(sizeof(Twhat) * self->mem##_count);    \
-        if (!reall) {                                                \
-            MEM_VECTOR_CLEAR(self, mem);                             \
+        if (!reall)                                                  \
             return false;                                            \
-        }                                                            \
         memcpy(reall, self->mem, sizeof(Twhat) * self->mem##_count); \
         mem_d(self->mem);                                            \
         self->mem = reall;                                           \