Files
UnrealEngineUWP/Engine/Source/Developer/SourceCodeAccess/Private/SourceCodeAccessModule.h
Jamie Dale ee3213c7df 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]
2014-08-05 10:29:53 -04:00

50 lines
1.7 KiB
C++

// Copyright 1998-2014 Epic Games, Inc. All Rights Reserved.
#pragma once
#include "ISourceCodeAccessModule.h"
#include "DefaultSourceCodeAccessor.h"
/**
* Implementation of ISourceCodeAccessModule
*/
class FSourceCodeAccessModule : public ISourceCodeAccessModule
{
public:
FSourceCodeAccessModule();
/** IModuleInterface implementation */
virtual void StartupModule() override;
virtual void ShutdownModule() override;
/** ISourceCodeAccessModule implementation */
virtual bool CanAccessSourceCode() const override;
virtual ISourceCodeAccessor& GetAccessor() const override;
virtual void SetAccessor(const FName& InName) override;
virtual FLaunchingCodeAccessor& OnLaunchingCodeAccessor() override;
virtual FDoneLaunchingCodeAccessor& OnDoneLaunchingCodeAccessor() override;
virtual FOpenFileFailed& OnOpenFileFailed() override;
private:
/** Handle when one of the modular features we are interested in is registered */
void HandleModularFeatureRegistered(const FName& Type, IModularFeature* ModularFeature);
/** Handle when one of the modular features we are interested in is unregistered */
void HandleModularFeatureUnregistered(const FName& Type, IModularFeature* ModularFeature);
private:
/** Event delegate fired when launching code accessor */
FLaunchingCodeAccessor LaunchingCodeAccessorDelegate;
/** Event delegate fired when done launching code accessor */
FDoneLaunchingCodeAccessor DoneLaunchingCodeAccessorDelegate;
/** Event delegate fired when opening a file has failed */
FOpenFileFailed OpenFileFailedDelegate;
/** The default accessor we will use if we have no IDE */
FDefaultSourceCodeAccessor DefaultSourceCodeAccessor;
/** The current accessor */
ISourceCodeAccessor* CurrentSourceCodeAccessor;
};