From 41fa9bfc469a3d681f40504f2a6035bd8319d417 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Thu, 16 Nov 2006 23:36:54 +0000 Subject: [PATCH] Corrected double destruction of views git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@43452 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- wxPython/wx/lib/docview.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/wxPython/wx/lib/docview.py b/wxPython/wx/lib/docview.py index 8f85b4be2f..83423dbf1b 100644 --- a/wxPython/wx/lib/docview.py +++ b/wxPython/wx/lib/docview.py @@ -1387,7 +1387,8 @@ class DocManager(wx.EvtHandler): for document in self._docs[::-1]: # Close in lifo (reverse) order. We clone the list to make sure we go through all docs even as they are deleted if not self.CloseDocument(document, force): return False - document.DeleteAllViews() # Implicitly delete the document when the last view is removed + if document: + document.DeleteAllViews() # Implicitly delete the document when the last view is removed return True -- 2.47.2