From 82eae78f7ec413053858500da960d78b49887568 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Fri, 3 Feb 2017 13:11:55 +0100 Subject: [PATCH] - fixed a small memory leak in the texture manager. --- src/gl/textures/gl_material.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/gl/textures/gl_material.cpp b/src/gl/textures/gl_material.cpp index 8bb8ee6f0..040066deb 100644 --- a/src/gl/textures/gl_material.cpp +++ b/src/gl/textures/gl_material.cpp @@ -592,8 +592,16 @@ bool FMaterial::TrimBorders(int *rect) } int size = w*h; - if (size == 1) return false; - + if (size == 1) + { + // nothing to be done here. + rect[0] = 0; + rect[1] = 0; + rect[2] = 1; + rect[3] = 1; + delete[] buffer; + return true; + } int first, last; for(first = 0; first < size; first++)