Made it so that the font collector does not crash Aegisub when it is built with both no freetype and no fontconfig.

Originally committed to SVN as r3252.
This commit is contained in:
Thomas Goyne 2009-07-24 02:30:11 +00:00
parent 83bb2ecedd
commit e21337f34f
2 changed files with 9 additions and 4 deletions

View file

@ -589,7 +589,7 @@ bool FontsCollectorThread::AttachFont(wxString filename) {
// Get fonts from ass overrides
void FontsCollectorThread::GetFonts (wxString tagName,int par_n,AssOverrideParameter *param,void *usr) {
if (tagName == _T("\\fn")) {
instance->AddFont(param->AsText(),1);
if (instance) instance->AddFont(param->AsText(),1);
}
}

View file

@ -85,15 +85,20 @@ void FontFileLister::GetInstance() {
// Redirect statics to the instance
wxArrayString FontFileLister::GetFilesWithFace(wxString facename) {
GetInstance();
return instance->DoGetFilesWithFace(facename);
if (instance)
return instance->DoGetFilesWithFace(facename);
else {
wxArrayString ret;
return ret;
}
}
void FontFileLister::Initialize() {
GetInstance();
instance->DoInitialize();
if (instance) instance->DoInitialize();
}
void FontFileLister::ClearData() {
GetInstance();
instance->DoClearData();
if (instance) instance->DoClearData();
}