summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/BlockInfo.cpp21
1 files changed, 6 insertions, 15 deletions
diff --git a/src/BlockInfo.cpp b/src/BlockInfo.cpp
index 32fdec905..b084d0915 100644
--- a/src/BlockInfo.cpp
+++ b/src/BlockInfo.cpp
@@ -9,6 +9,7 @@
cBlockInfo cBlockInfo::ms_Info[256];
+static bool g_IsBlockInfoInitialized = false;
@@ -43,6 +44,11 @@ cBlockInfo::~cBlockInfo()
cBlockInfo & cBlockInfo::Get(BLOCKTYPE a_Type)
{
+ if (!g_IsBlockInfoInitialized)
+ {
+ cBlockInfo::Initialize();
+ g_IsBlockInfoInitialized = true;
+ }
return ms_Info[a_Type];
}
@@ -448,18 +454,3 @@ void cBlockInfo::Initialize(void)
-
-// This is actually just some code that needs to run at program startup, so it is wrapped into a global var's constructor:
-class cBlockInfoInitializer
-{
-public:
- cBlockInfoInitializer(void)
- {
- cBlockInfo::Initialize();
- }
-} BlockInfoInitializer;
-
-
-
-
-