Fix asyncio error when closing the app

Fix #310, https://github.com/GNS3/gns3-gui/issues/705
This commit is contained in:
Julien Duponchelle committed 2015-10-12 16:16:44 +02:00
1 parent a6286db7b1
commit 0a536278fc
3 files changed
+4 -6

No files matched your search

-1
View File
@@ -61,7 +61,6 @@ class BaseVM:
def __del__(self):
self.close()
if self._temporary_directory is not None:
if os.path.exists(self._temporary_directory):
shutil.rmtree(self._temporary_directory, ignore_errors=True)
+2 -2
View File
@@ -588,7 +588,7 @@ class QemuVM(BaseVM):
log.error("Could not start QEMU {}: {}\n{}".format(self.qemu_path, e, stdout))
raise QemuError("Could not start QEMU {}: {}\n{}".format(self.qemu_path, e, stdout))
self._set_process_priority()
yield from self._set_process_priority()
if self._cpu_throttling:
self._set_cpu_throttling()
@@ -603,7 +603,7 @@ class QemuVM(BaseVM):
log.info('Stopping QEMU VM "{}" PID={}'.format(self._name, self._process.pid))
try:
self._process.terminate()
self._process.wait()
yield from self._process.wait()
except subprocess.TimeoutExpired:
try:
self._process.kill()