You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
Fixed crash closing the editor with SVN source control enabled
TTP# 342872 - EDITOR: Regression: CRASH: FSourceControlModule::ShutdownModule The SVN source control provider module was being shutdown before the main source control module, leading to a crash. The source control module now watches for its active provider module being unloaded, and will gracefully reset itself to the default (dummy) provider if that happens. I also added these same checks to the source code access module, as it uses the same provider modules mechanism. #codereview Thomas.Sarkanen, Max.Preussner [CL 2244286 by Jamie Dale in Main branch]
This commit is contained in:
@@ -23,6 +23,7 @@ void FSourceCodeAccessModule::StartupModule()
|
||||
|
||||
// Register to check for source control features
|
||||
IModularFeatures::Get().OnModularFeatureRegistered().AddRaw(this, &FSourceCodeAccessModule::HandleModularFeatureRegistered);
|
||||
IModularFeatures::Get().OnModularFeatureUnregistered().AddRaw(this, &FSourceCodeAccessModule::HandleModularFeatureUnregistered);
|
||||
|
||||
// bind default accessor to editor
|
||||
IModularFeatures::Get().RegisterModularFeature(SourceCodeAccessorFeatureName, &DefaultSourceCodeAccessor);
|
||||
@@ -53,6 +54,7 @@ void FSourceCodeAccessModule::ShutdownModule()
|
||||
|
||||
// we don't care about modular features any more
|
||||
IModularFeatures::Get().OnModularFeatureRegistered().RemoveAll(this);
|
||||
IModularFeatures::Get().OnModularFeatureUnregistered().RemoveAll(this);
|
||||
}
|
||||
|
||||
bool FSourceCodeAccessModule::CanAccessSourceCode() const
|
||||
@@ -102,7 +104,7 @@ FOpenFileFailed& FSourceCodeAccessModule::OnOpenFileFailed()
|
||||
return OpenFileFailedDelegate;
|
||||
}
|
||||
|
||||
void FSourceCodeAccessModule::HandleModularFeatureRegistered(const FName& Type)
|
||||
void FSourceCodeAccessModule::HandleModularFeatureRegistered(const FName& Type, IModularFeature* ModularFeature)
|
||||
{
|
||||
if(Type == SourceCodeAccessorFeatureName)
|
||||
{
|
||||
@@ -131,4 +133,12 @@ void FSourceCodeAccessModule::HandleModularFeatureRegistered(const FName& Type)
|
||||
}
|
||||
}
|
||||
|
||||
void FSourceCodeAccessModule::HandleModularFeatureUnregistered(const FName& Type, IModularFeature* ModularFeature)
|
||||
{
|
||||
if(Type == SourceCodeAccessorFeatureName && CurrentSourceCodeAccessor == static_cast<ISourceCodeAccessor*>(ModularFeature))
|
||||
{
|
||||
CurrentSourceCodeAccessor = &DefaultSourceCodeAccessor;
|
||||
}
|
||||
}
|
||||
|
||||
#undef LOCTEXT_NAMESPACE
|
||||
Reference in New Issue
Block a user