rv = NS_InitXPCOM(NULL, NULL, NULL);
rv = NS_InitXPCOM(NULL, NULL);
int main(int argc, char* argv[]){#if defined(XP_UNIX)  InstallUnixSignalHandlers(argv[0]);#endif  nsresult rv;  /* -help and -version should return quick */  if (argc == 2) {	if ((PL_strcmp(argv[1], "-h") == 0) || (PL_strcmp(argv[1], "-help") == 0) || (PL_strcmp(argv[1], "--help") == 0)) {		DumpHelp(argv[0]);		return 0;	}	else if ((PL_strcmp(argv[1], "-v") == 0) || (PL_strcmp(argv[1], "-version") == 0) || (PL_strcmp(argv[1], "--version") == 0)) {		DumpVersion(argv[0]);		return 0;	}  }      if( !NS_CanRun() )    return 1;   NS_ShowSplashScreen();  rv = NS_InitXPCOM(NULL, NULL, NULL);  NS_ASSERTION( NS_SUCCEEDED(rv), "NS_InitXPCOM failed" );  {    //----------------------------------------------------------------    // XPInstall needs to clean up after any updates that couldn't    // be completed because components were in use. This must be done     // **BEFORE** any other components are loaded!    //    // Will also check to see if AutoReg is required due to version    // change or installation of new components    //    // (scoped in a block to force release of COMPtr)    //----------------------------------------------------------------    nsCOMPtr<nsISoftwareUpdate> su = do_GetService(kSoftUpdateCID,&rv);    if (NS_SUCCEEDED(rv))      su->StartupTasks();  }    nsresult result = main1( argc, argv );  {        // Scoping this in a block to force the pref service to be                   // released.         //	// save the prefs, in case they weren't saved	NS_WITH_SERVICE(nsIPref, prefs, kPrefCID, &rv);	NS_ASSERTION(NS_SUCCEEDED(rv), "failed to get prefs, so unable to save them");	if (NS_SUCCEEDED(rv)) {		prefs->SavePrefFile();	}    }#ifdef DETECT_WEBSHELL_LEAKS  if ( unsigned long count = NS_TotalWebShellsInExistence() )  {    printf("XXX WARNING: Number of webshells being leaked: %d \n", count);  }#endif  // at this point, all that is on the clipboard is a proxy object, but that object  // won't be valid once the app goes away. As a result, we need to force the data  // out of that proxy and properly onto the clipboard. This can't be done in the  // clipboard service's shutdown routine because it requires the parser/etc which  // has already been shutdown by the time the clipboard is shut down.  NS_WITH_SERVICE(nsIClipboard, clipService, "component://netscape/widget/clipboard", &rv);  if ( clipService )    clipService->ForceDataToClipboard();  rv = NS_ShutdownXPCOM( NULL );  NS_ASSERTION(NS_SUCCEEDED(rv), "NS_ShutdownXPCOM failed");  return TranslateReturnValue( result );}