Closed jiml521 closed 8 years ago
Thanks for bringing this to my attention.
Checking out the delete function in the class definition of vboxapi.VirtualBoxManager:
def deinit(self):
"""
For unitializing the manager.
Do not access it after calling this method.
"""
if hasattr(self, "vbox"):
del self.vbox
self.vbox = None
if hasattr(self, "platform"):
self.platform.deinit()
self.platform = None
return True;
def __del__(self):
self.deinit()
I wonder if you wrapped the self.deinit() func in an exception handler if that would resolve your issue (hack the vboxapi for the test)? If that is the problem I think we could add an atexit hook that explicitly deinit's each VirtualBoxManager object when the interpreter is exited.
This problem could also be due to the crazy context import vboxapi with a VirtualBoxManager per process code that was required to make multiprocessing library work sanely in pyvbox's virtualbox/init.py function (avoids this https://www.virtualbox.org/ticket/12127).
Yes - wrapping that func with a try/except solves the problem in the short term. Thanks for the advice.
On Mon, May 18, 2015 at 9:02 AM, Michael Dorman notifications@github.com wrote:
Thanks for bringing this to my attention.
Checking out the delete function in the class definition of vboxapi.VirtualBoxManager:
def deinit(self): """ For unitializing the manager. Do not access it after calling this method. """ if hasattr(self, "vbox"): del self.vbox self.vbox = None if hasattr(self, "platform"): self.platform.deinit() self.platform = None return True; def __del__(self): self.deinit()
I wonder if you wrapped the self.deinit() func in an exception handler if that would resolve your issue (hack the vboxapi for the test)? If that is the problem I think we could add an atexit hook that explicitly deinit's each VirtualBoxManager object when the interpreter is exited.
This problem could also be due to the crazy context import vboxapi with a VirtualBoxManager per process code that was required to make multiprocessing library work sanely in pyvbox's virtualbox/init.py function (avoids this https://www.virtualbox.org/ticket/12127).
— Reply to this email directly or view it on GitHub https://github.com/mjdorma/pyvbox/issues/35#issuecomment-103052121.
I just uploaded a 0.2.1 release which has cleanup code to attempt a denint. Please let me know if this resolves your issue.
The vboxapi code has a fair few dags like:
if hasattr(self, "vbox"):
del self.vbox
self.vbox = None
It should be either checking if vbox is None already or performing a delattr(self, 'vbox').
I'll give it a try and let you know. Thanks for the fast turn-around!
--Jim L
On Mon, May 18, 2015 at 9:15 PM, Michael Dorman notifications@github.com wrote:
I just uploaded a 0.2.1 release which has cleanup code to attempt a denint. Please let me know if this resolves your issue.
The vboxapi code has a fair few dags like:
if hasattr(self, "vbox"): del self.vbox self.vbox = None
It should be either checking if vbox is None already or performing a setattr(self, 'vbox', None).
— Reply to this email directly or view it on GitHub https://github.com/mjdorma/pyvbox/issues/35#issuecomment-103290090.
This worked, btw. On vacation and forgot to respond. Thanks again.
I had the same issue. I moved from win32file import CloseHandle
from within PlatformMSCOM::deinit()
to a globel location (just before the class definition) to solve it.
Hope it is usefull.
Hi, After completing a script run to control a VirtualBox guest, the script ends with:
I assume this is because something is still open or allocated; session.unlock_machine() doesn't help.
My question: is this a pyvbox bug, or vboxapi bug?