Browse Source

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.
pull/8/head
Anton Tarasenko 3 years ago
parent
commit
ef6770a4e5
  1. 10
      sources/Features/Feature.uc

10
sources/Features/Feature.uc

@ -72,10 +72,14 @@ var private string defaultConfigName;
var private LoggerAPI.Definition errorBadConfigData; 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) { if (default.configClass != none) {
default.configClass.static.Initialize(); default.configClass.static.Initialize();
} }

Loading…
Cancel
Save