X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/eb2d0d232c7d9ba22c5e82d5b7413b2d647e6c9c..c7bd016e16408bbd88a89a9089b35edcebedcb3e:/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; }