VirtualBox

Ignore:
Timestamp:
Jan 26, 2011 4:37:16 PM (14 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
69665
Message:

Main: reworked listener objects creation, fixes Win problems with events, few cleanups

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VBoxHeadless/VBoxHeadless.cpp

    r35446 r35722  
    9999
    100100    virtual ~VirtualBoxClientEventListener()
     101    {
     102    }
     103
     104    HRESULT init()
     105    {
     106        return S_OK;
     107    }
     108
     109    void uninit()
    101110    {
    102111    }
     
    145154
    146155    virtual ~VirtualBoxEventListener()
     156    {
     157    }
     158
     159    HRESULT init()
     160    {
     161        return S_OK;
     162    }
     163
     164    void uninit()
    147165    {
    148166    }
     
    252270
    253271    virtual ~ConsoleEventListener()
     272    {
     273    }
     274
     275    HRESULT init()
     276    {
     277        return S_OK;
     278    }
     279
     280    void uninit()
    254281    {
    255282    }
     
    763790    ComPtr<IMachine> machine;
    764791    bool fSessionOpened = false;
    765     IEventListener *vboxClientListener = NULL;
    766     IEventListener *vboxListener = NULL;
    767     ConsoleEventListenerImpl *consoleListener = NULL;
     792    ComPtr<IEventListener> vboxClientListener;
     793    ComPtr<IEventListener> vboxListener;
     794    ComObjPtr<ConsoleEventListenerImpl> consoleListener;
    768795
    769796    do
     
    10011028            ComPtr<IEventSource> pES;
    10021029            CHECK_ERROR(pVirtualBoxClient, COMGETTER(EventSource)(pES.asOutParam()));
    1003             vboxClientListener = new VirtualBoxClientEventListenerImpl();
     1030            ComObjPtr<VirtualBoxClientEventListenerImpl> listener;
     1031            listener.createObject();
     1032            listener->init(new VirtualBoxClientEventListener());
     1033            vboxClientListener = listener;
    10041034            com::SafeArray<VBoxEventType_T> eventTypes;
    10051035            eventTypes.push_back(VBoxEventType_OnVBoxSVCAvailabilityChanged);
     
    10111041            ComPtr<IEventSource> es;
    10121042            CHECK_ERROR(console, COMGETTER(EventSource)(es.asOutParam()));
    1013             consoleListener = new ConsoleEventListenerImpl();
     1043            consoleListener.createObject();
     1044            consoleListener->init(new ConsoleEventListener());
    10141045            com::SafeArray<VBoxEventType_T> eventTypes;
    10151046            eventTypes.push_back(VBoxEventType_OnMouseCapabilityChanged);
     
    11661197            ComPtr<IEventSource> es;
    11671198            CHECK_ERROR(virtualBox, COMGETTER(EventSource)(es.asOutParam()));
    1168             vboxListener = new VirtualBoxEventListenerImpl();
     1199            ComObjPtr<VirtualBoxEventListenerImpl> listener;
     1200            listener.createObject();
     1201            listener->init(new VirtualBoxEventListener());
     1202            vboxListener = listener;
    11691203            com::SafeArray<VBoxEventType_T> eventTypes;
    11701204            eventTypes.push_back(VBoxEventType_OnGuestPropertyChanged);
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