Unhide console on Windows right before exit (we don't want to leave zombies behind)
This commit is contained in:
parent
c140e9313e
commit
c6e305343c
@ -632,19 +632,23 @@ def main():
|
|||||||
args, unparsed_args = parser.parse_known_args()
|
args, unparsed_args = parser.parse_known_args()
|
||||||
debug = args.debug
|
debug = args.debug
|
||||||
|
|
||||||
# Hide console window on Windows
|
try:
|
||||||
if sys.platform == 'win32' and not debug:
|
# Hide console window on Windows
|
||||||
from qspectrumanalyzer import windows
|
if sys.platform == 'win32' and not debug:
|
||||||
if windows.is_attached_console_visible():
|
from qspectrumanalyzer import windows
|
||||||
windows.set_attached_console_visible(False)
|
windows.set_attached_console_visible(False)
|
||||||
|
|
||||||
# Start PyQt application
|
# Start PyQt application
|
||||||
app = QtWidgets.QApplication(sys.argv[:1] + unparsed_args)
|
app = QtWidgets.QApplication(sys.argv[:1] + unparsed_args)
|
||||||
app.setOrganizationName("QSpectrumAnalyzer")
|
app.setOrganizationName("QSpectrumAnalyzer")
|
||||||
app.setOrganizationDomain("qspectrumanalyzer.eutopia.cz")
|
app.setOrganizationDomain("qspectrumanalyzer.eutopia.cz")
|
||||||
app.setApplicationName("QSpectrumAnalyzer")
|
app.setApplicationName("QSpectrumAnalyzer")
|
||||||
window = QSpectrumAnalyzerMainWindow()
|
window = QSpectrumAnalyzerMainWindow()
|
||||||
sys.exit(app.exec_())
|
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__":
|
if __name__ == "__main__":
|
||||||
|
Loading…
Reference in New Issue
Block a user