X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/d98a58c543948d84d9287e6fa53a5539d662b7a5..0f5378d414cb68caaa535199c1af12dec1720c3d:/src/common/fileconf.cpp?ds=sidebyside diff --git a/src/common/fileconf.cpp b/src/common/fileconf.cpp index 75fcd7c88a..4b63270320 100644 --- a/src/common/fileconf.cpp +++ b/src/common/fileconf.cpp @@ -1818,6 +1818,11 @@ bool wxFileConfigGroup::DeleteEntry(const wxString& name) // pNewLast can be NULL here -- it's ok and can happen if we have no // entries left m_pLastEntry = pNewLast; + + // For the root group only, we could be removing the first group line + // here, so update m_pLine to avoid keeping a dangling pointer. + if ( pLine == m_pLine ) + SetLine(NULL); } m_pConfig->LineListRemove(pLine);