summaryrefslogtreecommitdiff
path: root/src/VBox/Main/src-all/EventImpl.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/VBox/Main/src-all/EventImpl.cpp')
-rw-r--r--src/VBox/Main/src-all/EventImpl.cpp41
1 files changed, 24 insertions, 17 deletions
diff --git a/src/VBox/Main/src-all/EventImpl.cpp b/src/VBox/Main/src-all/EventImpl.cpp
index ea6c0a38e..5c7ee87be 100644
--- a/src/VBox/Main/src-all/EventImpl.cpp
+++ b/src/VBox/Main/src-all/EventImpl.cpp
@@ -1,4 +1,4 @@
-/* $Id: EventImpl.cpp $ */
+/* $Id: EventImpl.cpp 36619 2011-04-08 07:51:31Z vboxsync $ */
/** @file
* VirtualBox COM Event class implementation
*/
@@ -85,7 +85,7 @@ struct VBoxEvent::Data
HRESULT VBoxEvent::FinalConstruct()
{
m = new Data;
- return S_OK;
+ return BaseFinalConstruct();
}
void VBoxEvent::FinalRelease()
@@ -95,6 +95,7 @@ void VBoxEvent::FinalRelease()
uninit();
delete m;
m = 0;
+ BaseFinalRelease();
}
}
@@ -802,6 +803,9 @@ HRESULT ListenerRecord::process(IEvent* aEvent,
{
aAlock.release();
rc = mListener->HandleEvent(aEvent);
+#ifdef RT_OS_WINDOWS
+ Assert(rc != RPC_E_WRONG_THREAD);
+#endif
aAlock.acquire();
}
if (aWaitable)
@@ -909,13 +913,14 @@ EventSource::~EventSource()
HRESULT EventSource::FinalConstruct()
{
m = new Data;
- return S_OK;
+ return BaseFinalConstruct();
}
void EventSource::FinalRelease()
{
uninit();
delete m;
+ BaseFinalRelease();
}
HRESULT EventSource::init(IUnknown *)
@@ -1182,9 +1187,7 @@ public:
DECLARE_PROTECT_FINAL_CONSTRUCT()
BEGIN_COM_MAP(PassiveEventListener)
- COM_INTERFACE_ENTRY(ISupportErrorInfo)
- COM_INTERFACE_ENTRY(IEventListener)
- COM_INTERFACE_ENTRY(IDispatch)
+ VBOX_DEFAULT_INTERFACE_ENTRIES(IEventListener)
END_COM_MAP()
PassiveEventListener()
@@ -1194,10 +1197,12 @@ public:
HRESULT FinalConstruct()
{
- return S_OK;
+ return BaseFinalConstruct();
}
void FinalRelease()
- {}
+ {
+ BaseFinalRelease();
+ }
// IEventListener methods
STDMETHOD(HandleEvent)(IEvent *)
@@ -1222,9 +1227,7 @@ public:
DECLARE_PROTECT_FINAL_CONSTRUCT()
BEGIN_COM_MAP(ProxyEventListener)
- COM_INTERFACE_ENTRY(ISupportErrorInfo)
- COM_INTERFACE_ENTRY(IEventListener)
- COM_INTERFACE_ENTRY(IDispatch)
+ VBOX_DEFAULT_INTERFACE_ENTRIES(IEventListener)
END_COM_MAP()
ProxyEventListener()
@@ -1234,10 +1237,12 @@ public:
HRESULT FinalConstruct()
{
- return S_OK;
+ return BaseFinalConstruct();
}
void FinalRelease()
- {}
+ {
+ BaseFinalRelease();
+ }
HRESULT init(IEventSource* aSource)
{
@@ -1277,9 +1282,7 @@ public:
DECLARE_PROTECT_FINAL_CONSTRUCT()
BEGIN_COM_MAP(EventSourceAggregator)
- COM_INTERFACE_ENTRY(ISupportErrorInfo)
- COM_INTERFACE_ENTRY(IEventSource)
- COM_INTERFACE_ENTRY(IDispatch)
+ VBOX_DEFAULT_INTERFACE_ENTRIES(IEventSource)
END_COM_MAP()
EventSourceAggregator()
@@ -1289,13 +1292,14 @@ public:
HRESULT FinalConstruct()
{
- return S_OK;
+ return BaseFinalConstruct();
}
void FinalRelease()
{
mEventSources.clear();
mListenerProxies.clear();
mSource->uninit();
+ BaseFinalRelease();
}
// internal public
@@ -1503,6 +1507,9 @@ STDMETHODIMP EventSourceAggregator::FireEvent(IEvent * aEvent,
{
ComPtr<IEventSource> es = *it;
rc = es->FireEvent(aEvent, aTimeout, aProcessed);
+ /* Current behavior is that aggregator's FireEvent() always succeeds,
+ so that multiple event sources don't affect each other. */
+ NOREF(rc);
}
return S_OK;