done: if (ccMan != NULL) nsServiceManager::ReleaseService( kCharsetConverterManagerCID, ccMan); if (decs != NULL) delete [] decs;
nsMenuItem ** array = (nsMenuItem **)mBrowserMoreMenu.GetArray(); PRInt32 size = mBrowserMoreMenu.GetUsage();   nsCOMPtr<nsICollation> collation = nsnull; res = GetCollation(getter_AddRefs(collation)); if (NS_SUCCEEDED(res)) QuickSort(array, 0, size - 1, collation);  for (i=0; i < size; i++) AddItemToContainer(aRDFServ, aCCMan, container, array[i]);  delete [] decs;
nsresult nsCharsetMenu::CreateBrowserMoreMenu(nsIRDFService * aRDFServ,                                               nsIStringBundle * aTitles,                                               nsIStringBundle * aData) {  nsresult res = NS_OK;  nsICharsetConverterManager * ccMan = NULL;  nsString ** decs = NULL;  PRInt32 count;  res = nsServiceManager::GetService(kCharsetConverterManagerCID,       kICharsetConverterManagerIID, (nsISupports **)&ccMan);  if (NS_FAILED(res)) goto done;  res = ccMan->GetDecoderList(&decs, &count);  if (NS_FAILED(res)) goto done;  // put the flagged charsets on null  RemoveFlaggedCharsets(decs, count, aData, ".notForBrowser", PR_TRUE);  res = FillRDFContainer(aRDFServ, kNC_BMCharsetMenuRoot, aTitles, decs, count);  if (NS_FAILED(res)) goto done;done:  if (ccMan != NULL) nsServiceManager::ReleaseService(      kCharsetConverterManagerCID, ccMan);  if (decs != NULL) delete [] decs;  return res;}