Index: /trunk/src/VBox/Main/MediumImpl.cpp
===================================================================
--- /trunk/src/VBox/Main/MediumImpl.cpp	(revision 30291)
+++ /trunk/src/VBox/Main/MediumImpl.cpp	(revision 30292)
@@ -1901,4 +1901,7 @@
 STDMETHODIMP Medium::Close()
 {
+    AutoCaller autoCaller(this);
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
+
     // we're accessing parent/child and backrefs, so lock the tree first, then ourselves
     AutoMultiWriteLock2 multilock(&m->pVirtualBox->getMediaTreeLockHandle(),
@@ -1941,4 +1944,7 @@
     // make a copy of VirtualBox pointer which gets nulled by uninit()
     ComObjPtr<VirtualBox> pVirtualBox(m->pVirtualBox);
+
+    // leave the AutoCaller, as otherwise uninit() will simply hang
+    autoCaller.release();
 
     /* Keep the locks held until after uninit, as otherwise the consistency
@@ -3131,4 +3137,7 @@
                                      MediumLockList &mediumLockList)
 {
+    AutoCaller autoCaller(this);
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
+
     HRESULT rc = S_OK;
 
@@ -3846,4 +3855,7 @@
 {
     AssertReturn(aProgress != NULL || aWait == true, E_FAIL);
+
+    AutoCaller autoCaller(this);
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     HRESULT rc = S_OK;
@@ -4609,4 +4621,7 @@
     if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
+    AutoCaller targetCaller(pTarget);
+    AssertComRCReturnRC(targetCaller.rc());
+
     HRESULT rc = S_OK;
     ComObjPtr <Progress> pProgress;
