OpenSim crash fixes, thx to Henri and Zauber

This commit is contained in:
Siana Gearz
2011-03-15 15:19:37 +01:00
parent 0eab7bd2a5
commit 7b98e5f2f1
10 changed files with 58 additions and 10 deletions

View File

@@ -65,6 +65,8 @@ LLFontManager *gFontManagerp = NULL;
FT_Library gFTLibrary = NULL;
bool LLFont::sOpenGLcrashOnRestart = false;
//static
void LLFontManager::initClass()
{
@@ -269,8 +271,11 @@ void LLFont::resetBitmapCache()
}
mFontBitmapCachep->reset();
if (!mIsFallback || !sOpenGLcrashOnRestart) // because this often crashes under Linux...
{
// Add the empty glyph`5
addGlyph(0, 0);
}
}
LLFontGlyphInfo* LLFont::getGlyphInfo(const llwchar wch) const

View File

@@ -151,6 +151,8 @@ public:
F32 getXKerning(const llwchar char_left, const llwchar char_right) const; // Get the kerning between the two characters
virtual void reset() = 0;
static bool sOpenGLcrashOnRestart;
protected:
virtual BOOL hasGlyph(const llwchar wch) const; // Has a glyph for this character
virtual BOOL addChar(const llwchar wch) const; // Add a new character to the font if necessary

View File

@@ -267,8 +267,16 @@ void LLFontGL::destroyAllGL()
{
if (sFontRegistry)
{
if (LLFont::sOpenGLcrashOnRestart)
{
// This will leak memory but will prevent a crash...
sFontRegistry = NULL;
}
else
{
sFontRegistry->destroyGL();
}
}
}
void LLFontGL::destroyGL()