VirtualBox

Ignore:
Timestamp:
Apr 17, 2009 4:27:28 PM (16 years ago)
Author:
vboxsync
Message:

cbinding: added event queues for callback support

File:
1 edited

Legend:

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

    r18895 r18998  
    3535using namespace std;
    3636
    37 static ISession            *Session;
    38 static IVirtualBox         *Ivirtualbox;
    39 static nsIServiceManager   *serviceManager;
    40 static nsIComponentManager *manager;
     37static ISession            *Session        = NULL;
     38static IVirtualBox         *Ivirtualbox    = NULL;
     39static nsIServiceManager   *serviceManager = NULL;
     40static nsIComponentManager *manager        = NULL;
     41static nsIEventQueue       *eventQ         = NULL;
    4142
    4243static void VBoxComUninitialize(void);
     
    9899    {
    99100        Log(("Cbinding: Could not get component manager! rc=%Rhrc\n",rc));
     101        VBoxComUninitialize();
     102        return;
     103    }
     104
     105    rc = NS_GetMainEventQ (&eventQ);
     106    if (NS_FAILED(rc))
     107    {
     108        Log(("Cbinding: Could not get xpcom event queue! rc=%Rhrc\n",rc));
    100109        VBoxComUninitialize();
    101110        return;
     
    136145    if (Ivirtualbox)
    137146        NS_RELEASE(Ivirtualbox);    // decrement refcount
     147    if (eventQ)
     148        NS_RELEASE(eventQ);         // decrement refcount
    138149    if (manager)
    139150        NS_RELEASE(manager);        // decrement refcount
     
    144155}
    145156
     157static void
     158VBoxGetEventQueue(nsIEventQueue **eventQueue)
     159{
     160    *eventQueue = eventQ;
     161}
     162
    146163static uint32_t
    147164VBoxVersion(void)
     
    175192        VBoxUtf8ToUtf16,
    176193
     194        VBoxGetEventQueue,
     195
    177196        VBOX_XPCOMC_VERSION
    178197    };
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