From a9b479bd53406df0c74f7154b24369e45e6c6b44 Mon Sep 17 00:00:00 2001
From: Karl Blomster <kalle.blomster@gmail.com>
Date: Wed, 8 Jul 2009 13:30:24 +0000
Subject: [PATCH] Re-fix the fix in r3091; the issue wasn't what I thought it
 was, it was that memory was being freed twice. Fixes #906.

Originally committed to SVN as r3100.
---
 aegisub/src/gl_text.cpp | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/aegisub/src/gl_text.cpp b/aegisub/src/gl_text.cpp
index 3689cba8e..620de6394 100644
--- a/aegisub/src/gl_text.cpp
+++ b/aegisub/src/gl_text.cpp
@@ -61,7 +61,6 @@ OpenGLText::~OpenGLText() {
 /////////
 // Reset
 void OpenGLText::Reset() {
-	for (unsigned int i=0;i<textures.size();i++) delete textures[i];
 	textures.clear();
 	glyphs.clear();
 }
@@ -268,8 +267,10 @@ OpenGLTextTexture::OpenGLTextTexture(int w,int h) {
 //////////////////////
 // Texture destructor
 OpenGLTextTexture::~OpenGLTextTexture() {
-	if (tex)
+	if (tex) {
 		glDeleteTextures(1,&tex);
+		tex = 0;
+	}
 }
 
 
-- 
GitLab