Unhide console on Windows right before exit (we don't want to leave zombies behind)

This commit is contained in:
Michal Krenek (Mikos) 2017-03-30 16:17:03 +02:00
parent c140e9313e
commit c6e305343c

View File

@ -632,10 +632,10 @@ def main():
args, unparsed_args = parser.parse_known_args()
debug = args.debug
try:
# Hide console window on Windows
if sys.platform == 'win32' and not debug:
from qspectrumanalyzer import windows
if windows.is_attached_console_visible():
windows.set_attached_console_visible(False)
# Start PyQt application
@ -645,6 +645,10 @@ def main():
app.setApplicationName("QSpectrumAnalyzer")
window = QSpectrumAnalyzerMainWindow()
sys.exit(app.exec_())
finally:
# Unhide console window on Windows (we don't want to leave zombies behind)
if sys.platform == 'win32' and not debug:
windows.set_attached_console_visible(True)
if __name__ == "__main__":