Commit a1f08342 authored by Kyrium's avatar Kyrium
Browse files

Add Deinitialize on subsystems

parent f90e6406
......@@ -27,6 +27,15 @@ void UKBFLContentCDOHelperSubsystem::Initialize(FSubsystemCollectionBase& Collec
Super::Initialize(Collection);
}
void UKBFLContentCDOHelperSubsystem::Deinitialize()
{
Initialized = false;
mModulesToCall.Empty();
mCDOCalled.Empty();
Super::Deinitialize();
}
void UKBFLContentCDOHelperSubsystem::BeginCDOForModule(UWorldModule* Module, ELifecyclePhase Phase)
{
UE_LOG(ContentCDOHelperSubsystem, Log, TEXT("BeginCDOForModule > %s"), *Module->GetName());
......
......@@ -28,8 +28,6 @@ void UKBFLCustomizerSubsystem::Initialize(FSubsystemCollectionBase& Collection)
void UKBFLCustomizerSubsystem::Deinitialize()
{
Super::Deinitialize();
if(mDefaultSwatchCollection)
for (auto SwatchMap : mSwatchIDMap)
{
......@@ -38,6 +36,13 @@ void UKBFLCustomizerSubsystem::Deinitialize()
if(Default->mCustomizations.Contains(SwatchMap.Value))
Default->mCustomizations.Remove(SwatchMap.Value);
}
mCalled.Empty();
mSwatchIDMap.Empty();
Initialized = false;
Gathered = false;
Super::Deinitialize();
}
void UKBFLCustomizerSubsystem::OnActorsInitialized(const UWorld::FActorsInitializedParams&)
......
......@@ -33,6 +33,15 @@ void UKBFLResourceNodeSubsystem::Initialize(FSubsystemCollectionBase& Collection
Super::Initialize(Collection);
}
void UKBFLResourceNodeSubsystem::Deinitialize()
{
mCalledModules.Empty();
mResourceNodeInformations.Empty();
Initialized = false;
Super::Deinitialize();
}
void UKBFLResourceNodeSubsystem::OnWorldBeginPlay()
{
if (!Initialized)
......
......@@ -21,6 +21,7 @@ class KBFL_API UKBFLContentCDOHelperSubsystem : public UWorldSubsystem
/** Implement this for initialization of instances of the system */
virtual void Initialize(FSubsystemCollectionBase& Collection) override;
virtual void Deinitialize() override;
public:
void OnWorldBeginPlay();
......
......@@ -33,6 +33,7 @@ class KBFL_API UKBFLResourceNodeSubsystem : public UWorldSubsystem
/** Implement this for initialization of instances of the system */
virtual void Initialize(FSubsystemCollectionBase& Collection) override;
virtual void Deinitialize() override;
public:
void OnWorldBeginPlay();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment