From 9f1d609bd6ba44cb2cb78ab695f0c9c7530e5e65 Mon Sep 17 00:00:00 2001 From: PySimpleGUI Date: Fri, 7 Aug 2020 06:48:14 -0400 Subject: [PATCH] Fixed crash when Window2 is closed. --- DemoPrograms/Demo_Design_Pattern_Multiple_Windows2.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/DemoPrograms/Demo_Design_Pattern_Multiple_Windows2.py b/DemoPrograms/Demo_Design_Pattern_Multiple_Windows2.py index bd4640dd..f44a250d 100644 --- a/DemoPrograms/Demo_Design_Pattern_Multiple_Windows2.py +++ b/DemoPrograms/Demo_Design_Pattern_Multiple_Windows2.py @@ -3,11 +3,12 @@ import PySimpleGUI as sg """ Multiple Window Design Pattern - Two windows - both remain active + Two windows - both remain active and visible Window 1 launches Window 2 Window 1 remains visible and active while Window 2 is active Closing Window 1 exits application + Copyright 2020 PySimpleGUI.org """ @@ -45,7 +46,8 @@ def main(): window2 = None window1.close() - window2.close() + if window2 is not None: + window2.close() if __name__ == '__main__':