You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
Deprecated delegate code removed.
Some fixes for deprecated code. #codereview robert.manuszewski [CL 2617562 by Steve Robb in Main branch]
This commit is contained in:
committed by
Steve.Robb@epicgames.com
parent
07eaa7faf4
commit
cbac34aabd
@@ -364,11 +364,9 @@ public:
|
||||
FOnSuspendStateChange OnServerSuspendState;
|
||||
|
||||
|
||||
#ifdef DELEGATE_DEPRECATED
|
||||
private:
|
||||
/** Handle to the registered InternalNotifyNetworkFailure delegate */
|
||||
FDelegateHandle InternalNotifyNetworkFailureDelegateHandle;
|
||||
#endif
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@@ -1093,12 +1093,8 @@ bool UClientUnitTest::ConnectFakeClient(FUniqueNetIdRepl* InNetID/*=NULL*/)
|
||||
|
||||
if (GEngine != NULL)
|
||||
{
|
||||
#ifdef DELEGATE_DEPRECATED
|
||||
InternalNotifyNetworkFailureDelegateHandle = GEngine->OnNetworkFailure().AddUObject(this,
|
||||
&UClientUnitTest::InternalNotifyNetworkFailure);
|
||||
#else
|
||||
GEngine->OnNetworkFailure().AddUObject(this, &UClientUnitTest::InternalNotifyNetworkFailure);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -1217,11 +1213,7 @@ void UClientUnitTest::CleanupFakeClient()
|
||||
|
||||
if (GEngine != NULL)
|
||||
{
|
||||
#ifdef DELEGATE_DEPRECATED
|
||||
GEngine->OnNetworkFailure().Remove(InternalNotifyNetworkFailureDelegateHandle);
|
||||
#else
|
||||
GEngine->OnNetworkFailure().RemoveUObject(this, &UClientUnitTest::InternalNotifyNetworkFailure);
|
||||
#endif
|
||||
}
|
||||
|
||||
// Immediately cleanup (or rather, start of next tick, as that's earliest possible time) after sending the RPC
|
||||
|
||||
@@ -23,11 +23,7 @@ void FFrameProfiler::Start()
|
||||
|
||||
const FStatsThreadState& Stats = FStatsThreadState::GetLocalState();
|
||||
|
||||
#ifdef DELEGATE_DEPRECATED
|
||||
OnNewFrameDelegateHandle = Stats.NewFrameDelegate.AddRaw(this, &FFrameProfiler::OnNewFrame);
|
||||
#else
|
||||
Stats.NewFrameDelegate.AddRaw(this, &FFrameProfiler::OnNewFrame);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@@ -37,12 +33,7 @@ void FFrameProfiler::Stop()
|
||||
{
|
||||
const FStatsThreadState& Stats = FStatsThreadState::GetLocalState();
|
||||
|
||||
#ifdef DELEGATE_DEPRECATED
|
||||
Stats.NewFrameDelegate.Remove(OnNewFrameDelegateHandle);
|
||||
#else
|
||||
Stats.NewFrameDelegate.RemoveRaw(this, &FFrameProfiler::OnNewFrame);
|
||||
#endif
|
||||
|
||||
|
||||
StatsMasterEnableSubtract();
|
||||
bActive = false;
|
||||
|
||||
@@ -40,10 +40,7 @@ class FNetcodeUnitTest : public INetcodeUnitTest
|
||||
{
|
||||
private:
|
||||
static FWorldDelegates::FWorldInitializationEvent::FDelegate OnWorldCreatedDelegate;
|
||||
|
||||
#ifdef DELEGATE_DEPRECATED
|
||||
static FDelegateHandle OnWorldCreatedDelegateHandle;
|
||||
#endif
|
||||
|
||||
public:
|
||||
/**
|
||||
@@ -58,11 +55,7 @@ public:
|
||||
OnWorldCreatedDelegate = FWorldDelegates::FWorldInitializationEvent::FDelegate::CreateStatic(
|
||||
&FNetcodeUnitTest::OnWorldCreated);
|
||||
|
||||
#ifdef DELEGATE_DEPRECATED
|
||||
OnWorldCreatedDelegateHandle = FWorldDelegates::OnPreWorldInitialization.Add(OnWorldCreatedDelegate);
|
||||
#else
|
||||
FWorldDelegates::OnPreWorldInitialization.Add(OnWorldCreatedDelegate);
|
||||
#endif
|
||||
|
||||
bSetDelegate = true;
|
||||
}
|
||||
@@ -104,19 +97,13 @@ public:
|
||||
}
|
||||
|
||||
// Now remove it, so it's only called once
|
||||
#ifdef DELEGATE_DEPRECATED
|
||||
FWorldDelegates::OnPreWorldInitialization.Remove(OnWorldCreatedDelegateHandle);
|
||||
#else
|
||||
FWorldDelegates::OnPreWorldInitialization.Remove(OnWorldCreatedDelegate);
|
||||
#endif
|
||||
}
|
||||
};
|
||||
|
||||
FWorldDelegates::FWorldInitializationEvent::FDelegate FNetcodeUnitTest::OnWorldCreatedDelegate = NULL;
|
||||
|
||||
#ifdef DELEGATE_DEPRECATED
|
||||
FDelegateHandle FNetcodeUnitTest::OnWorldCreatedDelegateHandle;
|
||||
#endif
|
||||
|
||||
|
||||
// Essential for getting the .dll to compile, and for the package to be loadable
|
||||
|
||||
@@ -21,11 +21,7 @@ FLogWindowManager::~FLogWindowManager()
|
||||
|
||||
if (CurEntry->LogWindow.IsValid())
|
||||
{
|
||||
#ifdef DELEGATE_DEPRECATED
|
||||
CurEntry->LogWindow->MultiOnWindowClosed.Remove(OnWindowClosedDelegateHandles.FindRef(CurEntry->LogWindow.Get()));
|
||||
#else
|
||||
CurEntry->LogWindow->MultiOnWindowClosed.RemoveRaw(this, &FLogWindowManager::OnWindowClosed);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,11 +29,7 @@ FLogWindowManager::~FLogWindowManager()
|
||||
{
|
||||
if (OverflowWindows[i].IsValid())
|
||||
{
|
||||
#ifdef DELEGATE_DEPRECATED
|
||||
OverflowWindows[i]->MultiOnWindowClosed.Remove(OnWindowClosedDelegateHandles.FindRef(OverflowWindows[i].Get()));
|
||||
#else
|
||||
OverflowWindows[i]->MultiOnWindowClosed.RemoveRaw(this, &FLogWindowManager::OnWindowClosed);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -136,12 +128,8 @@ TSharedPtr<SLogWindow> FLogWindowManager::CreateLogWindow(FString Title, ELogTyp
|
||||
|
||||
if (ReturnVal.IsValid())
|
||||
{
|
||||
#ifdef DELEGATE_DEPRECATED
|
||||
OnWindowClosedDelegateHandles.Add(ReturnVal.Get(),
|
||||
ReturnVal->MultiOnWindowClosed.AddRaw(this, &FLogWindowManager::OnWindowClosed));
|
||||
#else
|
||||
ReturnVal->MultiOnWindowClosed.AddRaw(this, &FLogWindowManager::OnWindowClosed);
|
||||
#endif
|
||||
|
||||
FSlateApplication::Get().AddWindow(ReturnVal.ToSharedRef());
|
||||
|
||||
|
||||
@@ -74,11 +74,8 @@ protected:
|
||||
/** Whether or not profiling is active */
|
||||
bool bActive;
|
||||
|
||||
|
||||
#ifdef DELEGATE_DEPRECATED
|
||||
/** Handle to the registered OnNewFrame delegate */
|
||||
FDelegateHandle OnNewFrameDelegateHandle;
|
||||
#endif
|
||||
};
|
||||
#endif
|
||||
|
||||
|
||||
@@ -107,13 +107,8 @@ public:
|
||||
{
|
||||
if (AttachedWorld != NULL)
|
||||
{
|
||||
#ifdef DELEGATE_DEPRECATED
|
||||
TickDispatchDelegateHandle = AttachedWorld->OnTickDispatch().AddRaw(this, &FWorldTickHook::TickDispatch);
|
||||
PostTickFlushDelegateHandle = AttachedWorld->OnPostTickFlush().AddRaw(this, &FWorldTickHook::PostTickFlush);
|
||||
#else
|
||||
AttachedWorld->OnTickDispatch().AddRaw(this, &FWorldTickHook::TickDispatch);
|
||||
AttachedWorld->OnPostTickFlush().AddRaw(this, &FWorldTickHook::PostTickFlush);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@@ -121,13 +116,8 @@ public:
|
||||
{
|
||||
if (AttachedWorld != NULL)
|
||||
{
|
||||
#ifdef DELEGATE_DEPRECATED
|
||||
AttachedWorld->OnPostTickFlush().Remove(PostTickFlushDelegateHandle);
|
||||
AttachedWorld->OnTickDispatch().Remove(TickDispatchDelegateHandle);
|
||||
#else
|
||||
AttachedWorld->OnPostTickFlush().RemoveRaw(this, &FWorldTickHook::PostTickFlush);
|
||||
AttachedWorld->OnTickDispatch().RemoveRaw(this, &FWorldTickHook::TickDispatch);
|
||||
#endif
|
||||
}
|
||||
|
||||
AttachedWorld = NULL;
|
||||
@@ -148,14 +138,12 @@ public:
|
||||
/** The world this is attached to */
|
||||
UWorld* AttachedWorld;
|
||||
|
||||
#ifdef DELEGATE_DEPRECATED
|
||||
private:
|
||||
/** Handle for Tick dispatch delegate */
|
||||
FDelegateHandle TickDispatchDelegateHandle;
|
||||
|
||||
/** Handle for PostTick dispatch delegate */
|
||||
FDelegateHandle PostTickFlushDelegateHandle;
|
||||
#endif
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@@ -137,11 +137,8 @@ protected:
|
||||
int LogWidth;
|
||||
int LogHeight;
|
||||
|
||||
|
||||
#ifdef DELEGATE_DEPRECATED
|
||||
/** Handles to registered OnWindowClosed delegates for particular windows */
|
||||
TMap<SLogWindow*, FDelegateHandle> OnWindowClosedDelegateHandles;
|
||||
#endif
|
||||
};
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user