VirtualBox

Changeset 19098 in vbox for trunk/src/VBox/Main


Ignore:
Timestamp:
Apr 22, 2009 9:08:07 AM (16 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
46259
Message:

VBoxXPCOMC: fixed memory leak as ppSession & ppVirtualBox were not being stored.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/cbinding/VBoxXPCOMC.cpp

    r19081 r19098  
    3737static ISession            *Session        = NULL;
    3838static IVirtualBox         *Ivirtualbox    = NULL;
    39 static nsIServiceManager   *serviceManager = NULL;
    4039static nsIComponentManager *manager        = NULL;
    4140static nsIEventQueue       *eventQ         = NULL;
     
    8483    *ppSession    = NULL;
    8584    *ppVirtualBox = NULL;
    86 
    87     /** @todo r=bird: what exactly is this supposed to acomplish? */
    88     Session     = *ppSession;
    89     Ivirtualbox = *ppVirtualBox;
    9085
    9186    rc = com::Initialize();
     
    138133
    139134    Log(("Cbinding: ISession object created.\n"));
     135
     136    /* Store ppSession & ppVirtualBox so that VBoxComUninitialize
     137     * can later take care of them while cleanup
     138     */
     139    Session     = *ppSession;
     140    Ivirtualbox = *ppVirtualBox;
     141
    140142}
    141143
     
    159161    if (manager)
    160162        NS_RELEASE(manager);        // decrement refcount
    161     if (serviceManager)
    162         NS_RELEASE(serviceManager); // decrement refcount
    163163    com::Shutdown();
    164164    Log(("Cbinding: Cleaned up the created IVirtualBox and ISession Objects.\n"));
Note: See TracChangeset for help on using the changeset viewer.

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