Hot Reload crashes Editor

For our project, this was caused by doing the following in an Actor’s constructor:

FSoftClassPath ClassReference = ...
UClass* MyClass = ClassReference.ResolveClass();
if (!MyClass)
{
    MyClass = ClassReference.TryLoadClass<AMyClass>();
}

Protecting this code with

if (!HasAnyFlags(RF_ClassDefaultObject))

solved the hot reloading issue.

1 Like