]> git.saurik.com Git - wxWidgets.git/blobdiff - src/xrc/xmlres.cpp
compilation fix after argv changes (move initialization from OnInitGui() to Initializ...
[wxWidgets.git] / src / xrc / xmlres.cpp
index ccacf0190560b355ff7ae36b5707adc603458fb4..52de6a660b4138fcae666d7cef98d2be14da3853 100644 (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;
     }