From 11bc1b2a77e100e9086c967e9a73c3750555a7b2 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Sat, 31 Aug 2002 09:51:52 +0000 Subject: [PATCH] Bug fix from Tom Jolly, which adds a check aginst a delete of gl textures in FTGLTextureFont destructor to prevent a NULL be passed to glDeleteTextures. This solves the crash on exit of osghud/osgtext. --- src/osgText/FTGLTextureFont.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/osgText/FTGLTextureFont.cpp b/src/osgText/FTGLTextureFont.cpp index 21087cb21..b4e5ef402 100644 --- a/src/osgText/FTGLTextureFont.cpp +++ b/src/osgText/FTGLTextureFont.cpp @@ -50,8 +50,11 @@ FTGLTextureFont::~FTGLTextureFont() ContextTextureId::iterator itr; for(itr=glContextTextureID.begin();itr != glContextTextureID.end(); itr++) { - glDeleteTextures( numTextures, (const GLuint*)*itr); - osgDelete [] *itr; + if (*itr) + { + glDeleteTextures( numTextures, (const GLuint*)*itr); + osgDelete [] *itr; + } } }