From 3b2a000ef54cccda4c6877a1c0eac8c86edcc3af Mon Sep 17 00:00:00 2001 From: =?utf8?q?V=C3=A1clav=20Slav=C3=ADk?= Date: Tue, 31 May 2005 22:31:13 +0000 Subject: [PATCH] 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 --- src/xrc/xmlres.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/xrc/xmlres.cpp b/src/xrc/xmlres.cpp index 4aa3658c3d..870363db17 100644 --- a/src/xrc/xmlres.cpp +++ b/src/xrc/xmlres.cpp @@ -1455,8 +1455,18 @@ static int XRCID_Lookup(const wxChar *str_id, int value_if_not_found = -2) return (*rec_var)->id; } +static void AddStdXRCID_Records(); + /*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); } @@ -1601,7 +1611,6 @@ public: wxXmlResourceModule() {} bool OnInit() { - AddStdXRCID_Records(); wxXmlResource::AddSubclassFactory(new wxXmlSubclassFactoryCXX); return true; } -- 2.45.2