fix for crash on startup (font system not initialized when first creating fonts)

meow-7.2.2
Richard Linden 2011-11-29 23:53:28 -08:00
parent acd047b6be
commit ff32ef773b
2 changed files with 8 additions and 2 deletions

View File

@ -55,7 +55,10 @@ FT_Library gFTLibrary = NULL;
//static
void LLFontManager::initClass()
{
gFontManagerp = new LLFontManager;
if (!gFontManagerp)
{
gFontManagerp = new LLFontManager;
}
}
//static
@ -136,7 +139,7 @@ BOOL LLFontFreetype::loadFace(const std::string& filename, F32 point_size, F32 v
FT_Done_Face(mFTFace);
mFTFace = NULL;
}
int error;
error = FT_New_Face( gFTLibrary,

View File

@ -4745,6 +4745,9 @@ void LLViewerWindow::initFonts(F32 zoom_factor)
{
LLFontGL::destroyAllGL();
// Initialize with possibly different zoom factor
LLFontManager::initClass();
LLFontGL::initClass( gSavedSettings.getF32("FontScreenDPI"),
mDisplayScale.mV[VX] * zoom_factor,
mDisplayScale.mV[VY] * zoom_factor,