fix a crash if freetype is not present (bug 200720). r=alecf, sr=darin.

git-svn-id: svn://10.0.0.236/trunk@140947 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
bryner%netscape.com
2003-04-09 23:36:23 +00:00
parent dd9da39189
commit 6447dcf7e0
2 changed files with 8 additions and 6 deletions

View File

@@ -119,6 +119,9 @@ nsIPref* nsFT2FontCatalog::sPref = nsnull;
NS_IMPL_ISUPPORTS1(nsFT2FontCatalog, nsIFontCatalogService)
nsFT2FontCatalog::nsFT2FontCatalog()
: mFontCatalog(nsnull),
mRange1Language(nsnull),
mRange2Language(nsnull)
{
#if (defined(MOZ_ENABLE_FREETYPE2))
nsresult rv;

View File

@@ -68,8 +68,7 @@ nsIFontCatalogService* nsFT2FontNode::sFcs = nsnull;
void
nsFT2FontNode::FreeGlobals()
{
nsServiceManager::ReleaseService("@mozilla.org/gfx/xfontcatalogservice;1",
sFcs);
NS_IF_RELEASE(sFcs);
if (mFreeTypeNodes) {
mFreeTypeNodes->Reset(FreeNode, nsnull);
@@ -87,10 +86,10 @@ nsFT2FontNode::InitGlobals()
sInited = PR_TRUE;
nsServiceManager::GetService("@mozilla.org/gfx/xfontcatalogservice;1",
NS_GET_IID(nsIFontCatalogService),
(nsISupports**) &sFcs);
if (!sFcs) {
nsresult rv = ::CallGetService("@mozilla.org/gfx/xfontcatalogservice;1",
&sFcs);
if (NS_FAILED(rv)) {
NS_ERROR("Font Catalog Service init failed\n");
return NS_ERROR_FAILURE;
}