X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/0edeeb6d96d31d342a6a283d2a9b625a1d0a7b96..8ecf7346462b78a53defa2684aaac83dbfa29521:/src/xrc/xmlres.cpp diff --git a/src/xrc/xmlres.cpp b/src/xrc/xmlres.cpp index ccacf01905..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 = 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; }