X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/eb2d0d232c7d9ba22c5e82d5b7413b2d647e6c9c..657309a52bd20b14d5a431a6d4d107fd76f9569a:/src/xrc/xmlres.cpp diff --git a/src/xrc/xmlres.cpp b/src/xrc/xmlres.cpp index 0d26338fc0..52de6a660b 100644 --- a/src/xrc/xmlres.cpp +++ b/src/xrc/xmlres.cpp @@ -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 = wxNewId(); + (*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; }