mirror of
https://github.com/MCV-Software/TWBlue.git
synced 2025-04-20 01:21:45 -04:00
#278: fix an exit via misc.restart.restart_application
as graceful.
This commit is contained in:
parent
d441536f01
commit
6311d541da
@ -656,7 +656,7 @@ class Controller(object):
|
||||
sessions.sessions[item].shelve()
|
||||
if system == "Windows":
|
||||
self.systrayIcon.RemoveIcon()
|
||||
pidpath = os.path.join(os.getenv("temp"), "{}.pid".format(application.name))
|
||||
pidpath = os.path.join(os.getenv("temp"), "client.pid")
|
||||
if os.path.exists(pidpath):
|
||||
os.remove(pidpath)
|
||||
widgetUtils.exit_application()
|
||||
|
@ -113,7 +113,7 @@ def is_running(pid):
|
||||
|
||||
def check_pid():
|
||||
"Insures that only one copy of the application is running at a time."
|
||||
pidpath = os.path.join(os.getenv("temp"), "{}.pid".format(application.name))
|
||||
pidpath = os.path.join(os.getenv("temp"), "client.pid")
|
||||
if os.path.exists(pidpath):
|
||||
with open(pidpath) as fin:
|
||||
pid = int(fin.read())
|
||||
|
@ -7,5 +7,8 @@ def restart_program():
|
||||
if not hasattr(sys, "frozen"):
|
||||
args.insert(0, sys.executable)
|
||||
if sys.platform == 'win32':
|
||||
pidpath = os.path.join(os.getenv("temp"), "client.pid")
|
||||
if os.path.exists(pidpath):
|
||||
os.remove(pidpath)
|
||||
args = ['"%s"' % arg for arg in args]
|
||||
os.execv(sys.executable, args)
|
Loading…
x
Reference in New Issue
Block a user