|
@@ -22,7 +22,6 @@ from __future__ import print_function
|
|
import os
|
|
import os
|
|
import sys
|
|
import sys
|
|
import getopt
|
|
import getopt
|
|
-import atexit
|
|
|
|
|
|
|
|
# i18n is taken care of in the grass library code.
|
|
# i18n is taken care of in the grass library code.
|
|
# So we need to import it before any of the GUI code.
|
|
# So we need to import it before any of the GUI code.
|
|
@@ -111,6 +110,11 @@ class GMApp(wx.App):
|
|
|
|
|
|
return True
|
|
return True
|
|
|
|
|
|
|
|
+ def OnExit(self):
|
|
|
|
+ """Clean up on exit"""
|
|
|
|
+ unregisterPid(os.getpid())
|
|
|
|
+ return super().OnExit()
|
|
|
|
+
|
|
|
|
|
|
def printHelp():
|
|
def printHelp():
|
|
""" Print program help"""
|
|
""" Print program help"""
|
|
@@ -137,10 +141,6 @@ def process_opt(opts, args):
|
|
return workspaceFile
|
|
return workspaceFile
|
|
|
|
|
|
|
|
|
|
-def cleanup():
|
|
|
|
- unregisterPid(os.getpid())
|
|
|
|
-
|
|
|
|
-
|
|
|
|
def main(argv=None):
|
|
def main(argv=None):
|
|
|
|
|
|
if argv is None:
|
|
if argv is None:
|
|
@@ -169,5 +169,4 @@ def main(argv=None):
|
|
app.MainLoop()
|
|
app.MainLoop()
|
|
|
|
|
|
if __name__ == "__main__":
|
|
if __name__ == "__main__":
|
|
- atexit.register(cleanup)
|
|
|
|
sys.exit(main())
|
|
sys.exit(main())
|