OpenSim crash fixes, thx to Henri and Zauber
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user