asyncjob: Do some cleanup to allow object to be garbage collected

Also ensure we don't carry around references to other objects
This commit is contained in:
Cole Robinson 2011-04-11 15:05:16 -04:00
parent d74066da21
commit 1180c9c4e3

View File

@ -137,8 +137,15 @@ class vmmAsyncJob(vmmGObjectUI):
self.exit_if_necessary(force_exit=True)
self.topwin.destroy()
self.cleanup()
return self._get_error()
def cleanup(self):
vmmGObjectUI.cleanup(self)
self.bg_thread = None
self.cancel_job = None
self.cancel_args = None
def delete(self, ignore1=None, ignore2=None):
thread_active = (self.bg_thread.isAlive() or not self.run_main)
if self.cancel_job and thread_active: