Fixed assert (and crash in debug) in wxFileConfigGroup::DeleteSubgroupByName
Backported from CVS head git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_4_BRANCH@20005 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -178,6 +178,7 @@ All:
|
|||||||
- fixed wxLANGUAGE_CHINESE_TAIWAN to use zh_TW catalogs
|
- fixed wxLANGUAGE_CHINESE_TAIWAN to use zh_TW catalogs
|
||||||
- added missing wx/quantize.h to install
|
- added missing wx/quantize.h to install
|
||||||
- improved wxScrolledWindow/sizer interaction
|
- improved wxScrolledWindow/sizer interaction
|
||||||
|
- fixed assert (and crash in debug) in wxFileConfigGroup::DeleteSubgroupByName
|
||||||
|
|
||||||
Unix (GUI):
|
Unix (GUI):
|
||||||
|
|
||||||
|
@@ -1512,13 +1512,17 @@ wxFileConfigGroup *wxFileConfigGroup::AddSubgroup(const wxString& strName)
|
|||||||
|
|
||||||
bool wxFileConfigGroup::DeleteSubgroupByName(const wxChar *szName)
|
bool wxFileConfigGroup::DeleteSubgroupByName(const wxChar *szName)
|
||||||
{
|
{
|
||||||
return DeleteSubgroup(FindSubgroup(szName));
|
wxFileConfigGroup * const pGroup = FindSubgroup(szName);
|
||||||
|
|
||||||
|
return pGroup ? DeleteSubgroup(pGroup) : FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Delete the subgroup and remove all references to it from
|
// Delete the subgroup and remove all references to it from
|
||||||
// other data structures.
|
// other data structures.
|
||||||
bool wxFileConfigGroup::DeleteSubgroup(wxFileConfigGroup *pGroup)
|
bool wxFileConfigGroup::DeleteSubgroup(wxFileConfigGroup *pGroup)
|
||||||
{
|
{
|
||||||
|
wxCHECK_MSG( pGroup, FALSE, _T("deleting non existing group?") );
|
||||||
|
|
||||||
wxLogTrace( _T("wxFileConfig"),
|
wxLogTrace( _T("wxFileConfig"),
|
||||||
_T("Deleting group '%s' from '%s'"),
|
_T("Deleting group '%s' from '%s'"),
|
||||||
pGroup->Name().c_str(),
|
pGroup->Name().c_str(),
|
||||||
@@ -1533,10 +1537,7 @@ bool wxFileConfigGroup::DeleteSubgroup(wxFileConfigGroup *pGroup)
|
|||||||
_T(" text: '%s'"),
|
_T(" text: '%s'"),
|
||||||
((m_pLine) ? m_pLine->Text().c_str() : wxEmptyString) );
|
((m_pLine) ? m_pLine->Text().c_str() : wxEmptyString) );
|
||||||
|
|
||||||
wxCHECK_MSG( pGroup != 0, FALSE, _T("deleting non existing group?") );
|
|
||||||
|
|
||||||
// delete all entries
|
// delete all entries
|
||||||
|
|
||||||
size_t nCount = pGroup->m_aEntries.Count();
|
size_t nCount = pGroup->m_aEntries.Count();
|
||||||
|
|
||||||
wxLogTrace(_T("wxFileConfig"),
|
wxLogTrace(_T("wxFileConfig"),
|
||||||
|
Reference in New Issue
Block a user