From 3ac41f9172db920ce4501b9b4188aba5649faa3c Mon Sep 17 00:00:00 2001
From: Richard Nelson <richard@lindenlab.com>
Date: Thu, 5 Apr 2007 21:18:32 +0000
Subject: [PATCH] fix for crash in debug mode when in renderGlyph()

reviewed by davep
---
 indra/llrender/llfontgl.cpp | 10 ----------
 1 file changed, 10 deletions(-)

diff --git a/indra/llrender/llfontgl.cpp b/indra/llrender/llfontgl.cpp
index 94a8eb822d8..f347219f7f8 100644
--- a/indra/llrender/llfontgl.cpp
+++ b/indra/llrender/llfontgl.cpp
@@ -674,7 +674,6 @@ S32 LLFontGL::render(const LLWString &wstr,
 	}
 
 
-	glBegin(GL_QUADS);
 	for (i = begin_offset; i < begin_offset + length; i++)
 	{
 		llwchar wch = wstr[i];
@@ -703,8 +702,6 @@ S32 LLFontGL::render(const LLWString &wstr,
 				break;
 			}
 
-			glEnd();
-
 			ext_image->bind();
 			const F32 ext_x = cur_render_x + (EXT_X_BEARING * sScaleX);
 			const F32 ext_y = cur_render_y + (EXT_Y_BEARING * sScaleY + mAscender - mLineHeight);
@@ -740,15 +737,12 @@ S32 LLFontGL::render(const LLWString &wstr,
 
 			// Bind the font texture
 			mImageGLp->bind();
-			glBegin(GL_QUADS);
 		}
 		else
 		{
 			if (!hasGlyph(wch))
 			{
-				glEnd();
 				(const_cast<LLFontGL*>(this))->addChar(wch);
-				glBegin(GL_QUADS);
 			}
 
 			const LLFontGlyphInfo* fgi= getGlyphInfo(wch);
@@ -785,9 +779,7 @@ S32 LLFontGL::render(const LLWString &wstr,
 				// Kern this puppy.
 				if (!hasGlyph(next_char))
 				{
-					glEnd();
 					(const_cast<LLFontGL*>(this))->addChar(next_char);
-					glBegin(GL_QUADS);
 				}
 				cur_x += getXKerning(wch, next_char);
 			}
@@ -804,8 +796,6 @@ S32 LLFontGL::render(const LLWString &wstr,
 		}
 	}
 
-	glEnd();
-
 	if (right_x)
 	{
 		*right_x = cur_x / sScaleX;
-- 
GitLab