Commit 01e1f092 authored by Cédric Bellegarde's avatar Cédric Bellegarde

Handle SIGINT/SIGTERM in app

parent 6c724e4d
import sys
import signal
import os
import locale
import gettext
......@@ -47,7 +46,6 @@ if __name__ == "__main__":
app = Application("@VERSION@", os.path.join(extensiondir, 'webkitextension'))
signal.signal(signal.SIGINT, signal.SIG_DFL)
if 'EOLIE_TRACE' in os.environ:
graphviz = GraphvizOutput()
graphviz.output_file = 'eolie.png'
......@@ -25,6 +25,7 @@ from urllib.parse import urlparse
from getpass import getuser
from time import time
import json
from signal import signal, SIGINT, SIGTERM
from eolie.settings import Settings, SettingsDialog
from eolie.window import Window
......@@ -61,6 +62,8 @@ class Application(Gtk.Application):
self.__version = version
self.__state_cache = []
signal(SIGINT, lambda a, b: self.quit())
signal(SIGTERM, lambda a, b: self.quit())
# Set main thread name
# We force it to current python 3.6 name, to be sure in case of
# change in python
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment