From 82757b7a93e0d5e1bbec2b4ef5da2f30dd6babd0 Mon Sep 17 00:00:00 2001 From: chrys Date: Thu, 15 Sep 2016 00:21:22 +0200 Subject: [PATCH] shotdown everything more clean --- src/fenrir-package/fenrir.py | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/src/fenrir-package/fenrir.py b/src/fenrir-package/fenrir.py index 7f9ae378..4b97a605 100755 --- a/src/fenrir-package/fenrir.py +++ b/src/fenrir-package/fenrir.py @@ -57,12 +57,19 @@ class fenrir(): def captureSignal(self, siginit, frame): self.shutdownRequest() - def shutdown(self): - self.environment['runtime']['outputManager'].presentText(self.environment, "Quit Fenrir", soundIcon='ScreenReaderOff', interrupt=True) - + def shutdown(self): + self.environment['runtime']['inputManager'].releaseDevices(self.environment) + self.environment['runtime']['outputManager'].presentText(self.environment, "Quit Fenrir", soundIcon='ScreenReaderOff', interrupt=True) + if self.environment['runtime']['screenManager']: + self.environment['runtime']['screenManager'].shutdown(self.environment) + if self.environment['runtime']['commandManager']: + self.environment['runtime']['commandManager'].shutdown(self.environment) + if self.environment['runtime']['inputManager']: + self.environment['runtime']['inputManager'].shutdown(self.environment) + if self.environment['runtime']['outputManager']: + self.environment['runtime']['outputManager'].shutdown(self.environment) if self.environment['runtime']['screenDriver']: - self.environment['runtime']['screenDriver'].shutdown(self.environment) - self.environment['runtime']['inputManager'].releaseDevices(self.environment) + self.environment['runtime']['screenDriver'].shutdown(self.environment) if self.environment['runtime']['inputDriver']: self.environment['runtime']['inputDriver'].shutdown(self.environment) if self.environment['runtime']['soundDriver']: @@ -71,6 +78,7 @@ class fenrir(): self.environment['runtime']['speechDriver'].shutdown(self.environment) if self.environment['runtime']['debug']: self.environment['runtime']['debug'].closeDebugFile() + time.sleep(0.8) # wait a little before splatter it :) self.environment = None app = fenrir()