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:
@@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user