Quit Safe Eyes during the break Fix #269

This commit is contained in:
Gobinath 2019-02-23 09:57:53 -05:00
parent b927113c76
commit e3697f4c0e
3 changed files with 5 additions and 2 deletions

View File

@ -22,6 +22,7 @@ SafeEyes connects all the individual components and provide the complete applica
import atexit import atexit
import logging import logging
import os
from threading import Timer from threading import Timer
import dbus import dbus
@ -141,6 +142,8 @@ class SafeEyes(object):
self.plugins_manager.exit() self.plugins_manager.exit()
self.rpc_server.stop() self.rpc_server.stop()
Gtk.main_quit() Gtk.main_quit()
# Exit all threads
os._exit(0)
def handle_suspend_callback(self, sleeping): def handle_suspend_callback(self, sleeping):
""" """

View File

@ -81,7 +81,7 @@ def start_thread(target_function, **args):
""" """
Execute the function in a separate thread. Execute the function in a separate thread.
""" """
thread = threading.Thread(target=target_function, name="WorkThread", kwargs=args) thread = threading.Thread(target=target_function, name="WorkThread", daemon=False, kwargs=args)
thread.start() thread.start()

View File

@ -216,13 +216,13 @@ class TrayIcon(object):
Handle Quit menu action. Handle Quit menu action.
This action terminates the application. This action terminates the application.
""" """
self.quit()
with self.lock: with self.lock:
self.active = True self.active = True
# Notify all schedulers # Notify all schedulers
self.idle_condition.acquire() self.idle_condition.acquire()
self.idle_condition.notify_all() self.idle_condition.notify_all()
self.idle_condition.release() self.idle_condition.release()
self.quit()
def show_settings(self, *args): def show_settings(self, *args):
""" """