Skip to content

Commit

Permalink
fixed hanging issue if window gets closed
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexanderWillner committed Apr 12, 2020
1 parent 3394bde commit 63c4043
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions things3/things3_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

import sys
from os import system
from threading import Thread
from multiprocessing import Process
import webview # type: ignore
import objc # type: ignore # pylint: disable=unused-import # noqa F401
import pkg_resources.py2_warn # type: ignore # pylint: disable=unused-import # noqa F401
Expand Down Expand Up @@ -53,15 +53,17 @@ def main(self):
min_size=(1024, 600),
frameless=True)

thread = Thread(target=self.open_api)
thread = Process(target=self.open_api)
try:
thread.start()
webview.start()
webview.start() # blocking
thread.terminate()
thread.join()
except KeyboardInterrupt:
print("Shutting down...")
thread.terminate()
thread.join()
sys.exit(0)


if __name__ == "__main__":
Things3App().main()

0 comments on commit 63c4043

Please sign in to comment.