Skip to content

Commit 1597397

Browse files
committed
Installer/vboxapisetup.py: Delete the IHost and IVirtualBox objects once no
longer needed and before shutting down XPCOM (setup.py:oVBoxMgr.deinit() -> xpcom._xpcom.DeinitCOM() -> deinitVBoxPython() -> NS_ShutdownXPCOM()) which shuts down the interface manager (XPTI_FreeInterfaceInfoManager() -> xptiInterfaceInfoManager::FreeInterfaceInfoManager()). Otherwise during garbage collection later when these objects are deleted we will call back into the interface manager (PyXPCOM_TypeObject::Py_dealloc -> Py_nsIInterfaceInfo::~Py_nsIInterfaceInfo -> Py_nsISupports::~Py_nsISupports() -> Py_nsISupports::SafeRelease() -> ... -> xptiInterfaceInfo::Release() -> xptiInterfaceInfoManager::GetInfoMonitor() -> xptiInterfaceInfoManager::GetInterfaceInfoManagerNoAddRef()) after it has been free'd and trigger an exception and python stack trace. svn:sync-xref-src-repo-rev: r173369
1 parent 71b99d6 commit 1597397

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

src/VBox/Installer/common/vboxapisetup.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,8 @@ def testVBoxAPI():
140140
raise Exception('Host platform invalid!')
141141
print("Testing VirtualBox Python bindings successful: Detected VirtualBox %s (%d)" % (oVBox.version, oHost.architecture))
142142
_ = oVBox.getMachines()
143+
del oHost
144+
del oVBox
143145
oVBoxMgr.deinit()
144146
del oVBoxMgr
145147
except ImportError as exc:

0 commit comments

Comments
 (0)