if (gNodes) { gNodes->Reset(FreeNode, nsnull); delete gNodes; gNodes = nsnull;
if (gFFRENodes) { gFFRENodes->Reset(FreeNode, nsnull); delete gFFRENodes; gFFRENodes = nsnull; } if (gAFRENodes) { gAFRENodes->Reset(FreeNode, nsnull); delete gAFRENodes; gAFRENodes = nsnull;
FreeGlobals(void){  // XXX complete this  gInitialized = 0;  if (gAliases) {    delete gAliases;    gAliases = nsnull;  }  NS_IF_RELEASE(gCharSetManager);  if (gCharSetMaps) {    gCharSetMaps->Reset(FreeCharSetMap, nsnull);    delete gCharSetMaps;    gCharSetMaps = nsnull;  }  if (gFamilies) {    gFamilies->Reset(FreeFamily, nsnull);    delete gFamilies;    gFamilies = nsnull;  }  if (gGlobalList) {    delete gGlobalList;    gGlobalList = nsnull;  }  if (gCachedFFRESearches) {    gCachedFFRESearches->Reset(FreeNodeArray, nsnull);    delete gCachedFFRESearches;    gCachedFFRESearches = nsnull;  }  if (gNodes) {    gNodes->Reset(FreeNode, nsnull);    delete gNodes;    gNodes = nsnull;  }  NS_IF_RELEASE(gPref);  if (gSpecialCharSets) {    delete gSpecialCharSets;    gSpecialCharSets = nsnull;  }  if (gStretches) {    delete gStretches;    gStretches = nsnull;  }  NS_IF_RELEASE(gUnicode);  NS_IF_RELEASE(gUserDefined);  NS_IF_RELEASE(gUserDefinedConverter);  NS_IF_RELEASE(gUsersLocale);  NS_IF_RELEASE(gWesternLocale);  NS_IF_RELEASE(gFontSubConverter);  if (gWeights) {    delete gWeights;    gWeights = nsnull;  }  nsFontCharSetMap* charSetMap;  for (charSetMap=gCharSetMap; charSetMap->mFontLangGroup; charSetMap++) {    NS_IF_RELEASE(charSetMap->mFontLangGroup->mFontLangGroupAtom);    charSetMap->mFontLangGroup->mFontLangGroupAtom = nsnull;  }  FreeCCMap(gUserDefinedCCMap);  FreeCCMap(gEmptyCCMap);  FreeCCMap(gDoubleByteSpecialCharsCCMap);}