Index: /trunk/include/VBox/com/EventQueue.h
===================================================================
--- /trunk/include/VBox/com/EventQueue.h	(revision 31371)
+++ /trunk/include/VBox/com/EventQueue.h	(revision 31372)
@@ -54,8 +54,7 @@
 
     Event() {}
+    virtual ~Event() {};
 
 protected:
-
-    virtual ~Event() {};
 
     /**
Index: /trunk/src/VBox/Main/VirtualBoxImpl.cpp
===================================================================
--- /trunk/src/VBox/Main/VirtualBoxImpl.cpp	(revision 31371)
+++ /trunk/src/VBox/Main/VirtualBoxImpl.cpp	(revision 31372)
@@ -1933,7 +1933,6 @@
  *  method call.
  *
- *  @param event    event to post
- *                  (must be allocated using |new|, will be deleted automatically
- *                  by the event thread after processing)
+ *  @param event    event to post; must have been allocated using |new|, will
+ *                  be deleted automatically by the event thread after processing
  *
  *  @note Doesn't lock any object.
@@ -1941,21 +1940,26 @@
 HRESULT VirtualBox::postEvent(Event *event)
 {
-    AutoCaller autoCaller(this);
-    AssertComRCReturn(autoCaller.rc(), autoCaller.rc());
-
-    if (autoCaller.state() != Ready)
-    {
-        LogWarningFunc(("VirtualBox has been uninitialized (state=%d), the event is discarded!\n",
-                        autoCaller.state()));
-        return S_OK;
-    }
-
     AssertReturn(event, E_FAIL);
-    AssertReturn(m->pAsyncEventQ, E_FAIL);
-
-    if (m->pAsyncEventQ->postEvent(event))
-        return S_OK;
-
-    return E_FAIL;
+
+    HRESULT rc;
+    AutoCaller autoCaller(this);
+    if (SUCCEEDED((rc = autoCaller.rc())))
+    {
+        if (autoCaller.state() != Ready)
+            LogWarningFunc(("VirtualBox has been uninitialized (state=%d), the event is discarded!\n",
+                            autoCaller.state()));
+            // return S_OK
+        else if (    (m->pAsyncEventQ)
+                  && (m->pAsyncEventQ->postEvent(event))
+                )
+            return S_OK;
+        else
+            rc = E_FAIL;
+    }
+
+    // in any event of failure, we must clean up here, or we'll leak;
+    // the caller has allocated the object using new()
+    delete event;
+    return rc;
 }
 
