From ef6770a4e50c6600f5fa510a4881fda268d5627e Mon Sep 17 00:00:00 2001 From: Anton Tarasenko Date: Tue, 3 Aug 2021 15:40:55 +0700 Subject: [PATCH] Change config initializtion for `Feature`s We cannot rely on `Feature`'s static constructor to be called for every feature class, so we move out relevant code into separate `LoadConfigs()` method. --- sources/Features/Feature.uc | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/sources/Features/Feature.uc b/sources/Features/Feature.uc index 038e898..d37a25a 100644 --- a/sources/Features/Feature.uc +++ b/sources/Features/Feature.uc @@ -72,10 +72,14 @@ var private string defaultConfigName; var private LoggerAPI.Definition errorBadConfigData; -public static function StaticConstructor() +/** + * Loads all configs defined for the caller `Feature`'s class into internal + * collections. + * + * This method must be called only once, by initialization routines. + */ +public static final function LoadConfigs() { - if (StaticConstructorGuard()) return; - super.StaticConstructor(); if (default.configClass != none) { default.configClass.static.Initialize(); }