fixed initialization of standard IDs to happen before first use
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@34475 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -1455,8 +1455,18 @@ static int XRCID_Lookup(const wxChar *str_id, int value_if_not_found = -2)
|
|||||||
return (*rec_var)->id;
|
return (*rec_var)->id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void AddStdXRCID_Records();
|
||||||
|
|
||||||
/*static*/ int wxXmlResource::GetXRCID(const wxChar *str_id)
|
/*static*/ int wxXmlResource::GetXRCID(const wxChar *str_id)
|
||||||
{
|
{
|
||||||
|
static bool s_stdIDsAdded = false;
|
||||||
|
|
||||||
|
if ( !s_stdIDsAdded )
|
||||||
|
{
|
||||||
|
s_stdIDsAdded = true;
|
||||||
|
AddStdXRCID_Records();
|
||||||
|
}
|
||||||
|
|
||||||
return XRCID_Lookup(str_id);
|
return XRCID_Lookup(str_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1601,7 +1611,6 @@ public:
|
|||||||
wxXmlResourceModule() {}
|
wxXmlResourceModule() {}
|
||||||
bool OnInit()
|
bool OnInit()
|
||||||
{
|
{
|
||||||
AddStdXRCID_Records();
|
|
||||||
wxXmlResource::AddSubclassFactory(new wxXmlSubclassFactoryCXX);
|
wxXmlResource::AddSubclassFactory(new wxXmlSubclassFactoryCXX);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user