[wx-dev] [wxGTK?] wxTopLevelWindows list

Stefan.Neis at t-online.de Stefan.Neis at t-online.de
Tue Feb 26 11:40:47 PST 2008


       Hi,

> Since updating my application from 2.6 to 2.8 it seems to be always
crashing on
> exit - at least for wxGTK.
> The point seems to be that my application is essentially opening and
closing a
> number of dialogs, one after the other, but while they get nicely
added to
> the wxTopLevelWindows list (see wxTopLevelWindowGTK::Create, I
> suppose), they apparently never get removed from that list when I'm
closing
> and destroying them. And at shutdown,  wxAppBase::CleanUp (appcmn.cpp)
> loops over all those already destroyed and cleaned up windows,
deleting
>  them "again". So I get a crash because of the double delete...

Sorry for the wrong description, after some more debugging, I found the
problem
is actually vice versa: I forget to close a specific window (one handled
via
>   if (dlg->ShowDialog() ==wxID_CANCEL) return;
) and while wxAppBase::CleanUp does it's job, I get a crash (still
something
which looks like a double free). However, after explicitly destroying
the
window prior to returning and exiting, everything seems OK.

It's still mysterious to me, why the original code doesn't work (i.e. I
still believe
there's something wrong with wxGTK's cleanup code), but at least I have
a working version - which is good since I'm leaving for a holiday the
day after
tomorrow. ;-)

           Regards,
                     Stefan






More information about the wx-dev mailing list