VirtualBox

Changeset 16674 in vbox for trunk


Ignore:
Timestamp:
Feb 11, 2009 4:05:15 PM (16 years ago)
Author:
vboxsync
Message:

Main/Glue: com::Initialize(): Cleanup a failed XPCOM initialization before trying with a new path.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/glue/initterm.cpp

    r16649 r16674  
    456456
    457457        /* Finally, initialize XPCOM */
    458         nsCOMPtr <nsIServiceManager> serviceManager;
    459         rc = NS_InitXPCOM2 (getter_AddRefs (serviceManager),
    460                             appDir, dsProv);
    461 
    462         if (NS_SUCCEEDED (rc))
    463         {
    464             nsCOMPtr <nsIComponentRegistrar> registrar =
    465                 do_QueryInterface (serviceManager, &rc);
     458        {
     459            nsCOMPtr <nsIServiceManager> serviceManager;
     460            rc = NS_InitXPCOM2 (getter_AddRefs (serviceManager),
     461                                appDir, dsProv);
     462
    466463            if (NS_SUCCEEDED (rc))
    467464            {
    468                 rc = registrar->AutoRegister (nsnull);
     465                nsCOMPtr <nsIComponentRegistrar> registrar =
     466                    do_QueryInterface (serviceManager, &rc);
    469467                if (NS_SUCCEEDED (rc))
    470468                {
    471                     /* We succeeded, stop probing paths */
    472                     LogFlowFunc (("Succeeded.\n"));
    473                     break;
     469                    rc = registrar->AutoRegister (nsnull);
     470                    if (NS_SUCCEEDED (rc))
     471                    {
     472                        /* We succeeded, stop probing paths */
     473                        LogFlowFunc (("Succeeded.\n"));
     474                        break;
     475                    }
    474476                }
    475477            }
    476478        }
     479
     480        /* clean up before the new try */
     481        rc = NS_ShutdownXPCOM (nsnull);
    477482
    478483        if (i == 0)
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette