Merge pull request #3258 from PySimpleGUI/Dev-latest

Fixed crash when Window2 is closed.
This commit is contained in:
PySimpleGUI 2020-08-07 06:48:34 -04:00 committed by GitHub
commit 3c03054910
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 2 deletions

View File

@ -3,11 +3,12 @@ import PySimpleGUI as sg
""" """
Multiple Window Design Pattern Multiple Window Design Pattern
Two windows - both remain active Two windows - both remain active and visible
Window 1 launches Window 2 Window 1 launches Window 2
Window 1 remains visible and active while Window 2 is active Window 1 remains visible and active while Window 2 is active
Closing Window 1 exits application Closing Window 1 exits application
Copyright 2020 PySimpleGUI.org
""" """
@ -45,6 +46,7 @@ def main():
window2 = None window2 = None
window1.close() window1.close()
if window2 is not None:
window2.close() window2.close()