Renaming an in-use component in C++ results in a crash

Unreal 4.5.1-2336687+++depot+UE4-Releases+4.5
Visual Studio 2013 Premium

Rename an in-use component; build in MSDev; hot reload kicks off, but does not unload the original class.
So restart the editor and when it comes back attempt to edit a blueprint that references the original class and the editor falls over.

Surely on discovering a class that is not or no longer registered it is preferable for the runtime to skip it, flagging it with an error or warning rather than crash? Maybe I expect a crash in a built out game, but the editor is a development tool and I expect it to be tolerant of errors in an environment where code will always be changing frequently.

The worst thing here is that the blueprints with the missing class are now unusable requiring either a rebuild from scratch or a roll-back to an earlier revision.

.

ps. this time, expecting a problem, I first took a backup of my blueprint with the component removed…

Hi ,

I tried to reproduce this issue, but wasn’t able to. This is what I did:

  • Created a new Actor code class.

  • Created a new StaticMeshComponent for the class.

     UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "MyTest")
     TSubobjectPtr<class UStaticMeshComponent> TheMesh;
    
  • Initialized the component in the constructor.

     TheMesh = PCIP.CreateDefaultSubobject<UStaticMeshComponent>(this, TEXT("TheMesh"));
    
  • Built the project in Visual Studio.

  • Opened the project in the Editor.

  • Created a Blueprint based on the new class.

  • Assigned a Static Mesh to the StaticMeshComponent and placed an instance of the Blueprint in the level.

  • Renamed the component in the code class.

  • Built the project in Visual Studio to perform a hot reload in the Editor.

  • Shut down and restarted the Editor.

  • Opened the new Blueprint. The StaticMeshComponent shows the new name and I was able to change the assigned Static Mesh and recompile the Blueprint. This updated the Static Mesh displayed on the instance of the Blueprint in the game.

Where am I doing things differently from what you did to see the crash?

Hi! This one still happens for me.

1/. Make new c++ class CrasherComponent in UnrealEd. Parent is ActorComponent.

2/. Reload project in msdev.

3/. Add only UCLASS(meta = (BlueprintSpawnableComponent))

4/. Build.

5/. Create actor blueprint ‘crashme’. Add Crasher to it in the components tab. Appears as Crasher1

6/. Back to msdev. Rename CrasherComponent.cpp and CrasherComponent.h to BeverlyCrasherComponent.cpp and BeverlyCrasherComponent.h.

7/. Replace all instances of UCrasherComponent to UBeverlyCrasherComponent. Fix includes.

8/. Build and hot reload.

9/. Back to UnrealEd.

10/. Confirm that Crasher1 is still present in the components tab of ‘crashme’.

11/. Close UnrealEd,

12/. Restart UnrealEd.

13/. Double click to edit the blueprint of ‘crashme’.

14/. CRASH!

Crash info:

Unknown exception - code 00000001 (first/second not available)

Assertion failed: InSCSNode->ComponentTemplate != NULL [File:D:\BuildFarm\buildmachine_++depot+UE4-Releases+4.5\Engine\Source\Editor\Kismet\Private\SSCSEditor.cpp] [Line: 3081]

Hi ,

Thank you for the additional information. I was able to reproduce the crash you were seeing. I believe it is the same crash that you were seeing here, but I have entered a new report for this crash just to be safe (UE-6041).