added logic to manage automatically allocated ids in-use status to avoid clashes for long-running programs (modified patch 1800016, incidentally fixes bug 1832620)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@50007 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2007-11-16 23:25:18 +00:00
parent 9d46359178
commit f35fdf7e4a
4 changed files with 177 additions and 27 deletions

View File

@@ -47,6 +47,7 @@
#include "wx/xml/xml.h"
class wxXmlResourceDataRecord
{
public:
@@ -1610,7 +1611,7 @@ static int XRCID_Lookup(const char *str_id, int value_if_not_found = wxID_NONE)
}
else
{
(*rec_var)->id = wxWindow::NewControlId();
(*rec_var)->id = wxWindowBase::NewControlId();
}
}
@@ -1639,6 +1640,12 @@ static void CleanXRCID_Record(XRCID_record *rec)
if (rec)
{
CleanXRCID_Record(rec->next);
// if we had generated the value of this id automatically, release it
// now that we don't need it any longer
if ( wxWindow::IsAutoGeneratedId(rec->id) )
wxWindow::ReleaseControlId(rec->id);
free(rec->key);
delete rec;
}