Allow disabling saving wxFileConfig data when it is destroyed
This can be useful to avoid saving the changes performed by the user if this turns out to be undesirable, for whatever reason. Closes https://github.com/wxWidgets/wxWidgets/pull/1451 Closes #13788.
This commit is contained in:
committed by
Vadim Zeitlin
parent
e31938c314
commit
c525784f77
@@ -346,6 +346,7 @@ void wxFileConfig::Init()
|
||||
}
|
||||
|
||||
m_isDirty = false;
|
||||
m_autosave = true;
|
||||
}
|
||||
|
||||
// constructor supports creation of wxFileConfig objects of any type
|
||||
@@ -487,7 +488,8 @@ void wxFileConfig::CleanUp()
|
||||
|
||||
wxFileConfig::~wxFileConfig()
|
||||
{
|
||||
Flush();
|
||||
if ( m_autosave )
|
||||
Flush();
|
||||
|
||||
CleanUp();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user