1 commit 56a60ee50122613d3a356ce74b4bd77b5e7be235
2 Author: Tim Kosse <tim.kosse@filezilla-project.org>
3 Date: Sat Aug 26 15:37:30 2017 +0200
5 If a wxTopLevelWindow has been instanced, but Create has not been called, calling Destroy on the window results in an assertion in Show(false), at least under wxGTK. Fix this by only hiding a top level window during destruction if it is actually shown.
7 diff --git a/src/common/toplvcmn.cpp b/src/common/toplvcmn.cpp
8 index ef693690c5..8d07812031 100644
9 --- a/src/common/toplvcmn.cpp
10 +++ b/src/common/toplvcmn.cpp
11 @@ -122,19 +122,21 @@ bool wxTopLevelWindowBase::Destroy()
12 // any more as no events will be sent to the hidden window and without idle
13 // events we won't prune wxPendingDelete list and the application won't
15 - for ( wxWindowList::const_iterator i = wxTopLevelWindows.begin(),
16 - end = wxTopLevelWindows.end();
20 - wxTopLevelWindow * const win = static_cast<wxTopLevelWindow *>(*i);
21 - if ( win != this && win->IsShown() )
23 + for ( wxWindowList::const_iterator i = wxTopLevelWindows.begin(),
24 + end = wxTopLevelWindows.end();
28 - // there remains at least one other visible TLW, we can hide this
31 + wxTopLevelWindow * const win = static_cast<wxTopLevelWindow *>(*i);
32 + if ( win != this && win->IsShown() )
34 + // there remains at least one other visible TLW, we can hide this