Files
UnrealEngineUWP/Engine/Source/Editor/UnrealEd
henrik karlsson b11d35f80e [UnrealEd]
* Reverted the changes in 25904929 related to subclasses to TCommands<>.

This code relies on undefined behavior of how things are inlined. base class is a template with a static variable. One instance of that static variable exists in each dll/exe. To call TCommands<>::Get() would return the instance in the same dll.
But, because the subclass has dllexport on the type and not the members it will generate a Get function that is not inlined. The callsite when calling Get will actually then use the instantiated Get() function and not the inlined one.

So for

class API X : public TCommands<X> {}

it will (for now) work to call

X::Get() and get the same instantiated singletone.

Calling

TCommands<X>::Get() will definitely not work and return the singleton instantiated in the same dll/exe

#rb none

[CL 25909947 by henrik karlsson in ue5-main branch]
2023-06-09 23:42:49 -04:00
..
2023-06-09 17:15:53 -04:00
2023-04-13 12:15:13 -04:00
2023-06-09 17:15:53 -04:00
2023-06-09 23:42:49 -04:00