Files
UnrealEngineUWP/Engine/Source/Editor/UnrealEd/Private/Tools/AssetEditorContextObject.h
brooke hubert 5ba56cd7d3 Fix a crash in modes and mode manager when iterating over all objects and attempting to get the world.
# Although there aren't references left to the object, iterating over all the things will return the thing. Flagging as garbage seems a lot testier of a change for fixing the 5.1 crash with varied lifettime of the mode and mode manager contexts, so merely tracking it and reporting the correct world here.

#rnx
#Jira UE-168159
#rb lauren.barnes, zach.rammell
#preflight 6356f2ff3d41a4455a628b31
#lockdown jeanmichel.dignard

[CL 22787075 by brooke hubert in ue5-main branch]
2022-10-26 15:31:06 -04:00

33 lines
979 B
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#pragma once
#include "Tools/AssetEditorContextInterface.h"
#include "UObject/Object.h"
#include "AssetEditorContextObject.generated.h"
UCLASS(Transient)
class UAssetEditorContextObject : public UObject, public IAssetEditorContextInterface
{
GENERATED_BODY()
public:
// Begin UAssetEditorContextObject interface
const UTypedElementSelectionSet* GetSelectionSet() const override;
UTypedElementSelectionSet* GetMutableSelectionSet() override;
UTypedElementCommonActions* GetCommonActions() override;
UWorld* GetEditingWorld() const override;
const IToolkitHost* GetToolkitHost() const override;
IToolkitHost* GetMutableToolkitHost() override;
// End UAssetEditorContextObject interface
/**
* Set the toolkit host associated with our asset editor.
*/
void SetToolkitHost(IToolkitHost* InToolkitHost);
private:
/** The toolkit host associated with our asset editor. */
IToolkitHost* ToolkitHost = nullptr;
};