]> git.saurik.com Git - wxWidgets.git/blobdiff - src/xrc/xmlres.cpp
check that the version of __sync_sub_and_fetch that returns a value is supported...
[wxWidgets.git] / src / xrc / xmlres.cpp
index 0d26338fc0337feb4fb71398b2bf5a69aff985c3..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 = 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;
     }