Delete pending objects before destroying wxConfig during cleanup.

This allows these objects to save their state in wxConfig, as e.g. top level
windows using wxPersistenceManager do.

Closes #16397.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77652 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2014-09-10 16:51:11 +00:00
parent 8f8baa1de3
commit ed1e48b1ed
2 changed files with 8 additions and 1 deletions

View File

@@ -281,6 +281,10 @@ void wxAppConsoleBase::OnLaunched()
int wxAppConsoleBase::OnExit()
{
// Delete all pending objects first, they might use wxConfig to save their
// state during their destruction.
DeletePendingObjects();
#if wxUSE_CONFIG
// delete the config object if any (don't use Get() here, but Set()
// because Get() could create a new config object)

View File

@@ -129,7 +129,10 @@ wxAppBase::~wxAppBase()
void wxAppBase::CleanUp()
{
// clean up all the pending objects
// Clean up any still pending objects. Normally there shouldn't any as we
// already do this in OnExit(), but this could happen if the user code has
// somehow managed to create more of them since then or just forgot to call
// the base class OnExit().
DeletePendingObjects();
// and any remaining TLWs (they remove themselves from wxTopLevelWindows