python3Packages.orjson: Disable failing tests on 32 bit
[NixPkgs.git] / pkgs / development / libraries / wxwidgets / patches / 0001-fix-assertion-using-hide-in-destroy.patch
blobca9eb8bf612a578984b6cf514772460d26cc3c12
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
14 // terminate
15 - for ( wxWindowList::const_iterator i = wxTopLevelWindows.begin(),
16 - end = wxTopLevelWindows.end();
17 - i != end;
18 - ++i )
19 - {
20 - wxTopLevelWindow * const win = static_cast<wxTopLevelWindow *>(*i);
21 - if ( win != this && win->IsShown() )
22 + if ( IsShown() ) {
23 + for ( wxWindowList::const_iterator i = wxTopLevelWindows.begin(),
24 + end = wxTopLevelWindows.end();
25 + i != end;
26 + ++i )
28 - // there remains at least one other visible TLW, we can hide this
29 - // one
30 - Hide();
31 + wxTopLevelWindow * const win = static_cast<wxTopLevelWindow *>(*i);
32 + if ( win != this && win->IsShown() )
33 + {
34 + // there remains at least one other visible TLW, we can hide this
35 + // one
36 + Hide();
38 - break;
39 + break;
40 + }