diff --git a/PySimpleGUI.py b/PySimpleGUI.py index 7de09ce2..a51df3b5 100644 --- a/PySimpleGUI.py +++ b/PySimpleGUI.py @@ -1084,6 +1084,9 @@ class FlexForm: if self.RootNeedsDestroying: self.TKroot.destroy() _my_windows.Decrement() + # if form was closed with X + if self.LastButtonClicked is None and self.LastKeyboardEvent is None and self.ReturnValues[0] is None: + _my_windows.Decrement() if self.LastKeyboardEvent is not None or self.LastButtonClicked is not None: return BuildResults(self, False, self) else: diff --git a/__pycache__/PySimpleGUI.cpython-36.pyc b/__pycache__/PySimpleGUI.cpython-36.pyc deleted file mode 100644 index d418c670..00000000 Binary files a/__pycache__/PySimpleGUI.cpython-36.pyc and /dev/null differ