Hi!
I’m developing a custom node based editor using Unreal Engine EdGraph and i’ve run into this problem which i don’t how to fix: everytime i open my custom editor and right click for the FIRST TIME on a node pin WITHOUT SELECTING the owning node the engine freezes and runs out of memory, causing explorer.exe to crush.
After lots of investigations i found out that the console was printing this:
Ensure condition failed: !bGraphDataInvalid [File:D:\build++UE5\Sync\Engine\Source\Editor\GraphEditor\Private\SGraphPin.cpp] [Line: 905]
The Graph Pin Object has been invalidated. Someone is keeping a hard ref on the SGraphPin (SGameFlowNodePin [SGameFlowNode.cpp(116)]). See InvalidateGraphData for more info
which suggested me to take a look at the SGameFlowNode.cpp file at line 116, where i have this function:
> void SGameFlowNode::CreateStandardPinWidget(UEdGraphPin* Pin)
{
// Create the node pin widget. by default GameFlow will create an
// exec pin for the node.
const TSharedRef<SGameFlowNodePin> PinWidget = SNew(SGameFlowNodePin, Pin)
.ExecPinColor(FLinearColor::White)
.PinDiffColor(FLinearColor::White);
// Add the pin to this node.
this->AddPin(PinWidget);
}
I used Rider debugger and found out that SGraphPanel redraws the entire graph each time something changes or the user makes an action inside the graph, but i still don’t get what object it holding a reference to the invalid pin object, in my code i NEVER destroy node pin objs pins unless:
- User shutdowns graph editor.
- User has an option of deleting that specific pin for some reasons(nodes with add-pin buttons).
It is also strange that this behavior only happens ONCE; if, for example, i put a breakpoint, enable the debugger, hit the breakpoint right before the engine would freeze and then resume the program, the engine DO NOT CRASHES! After that i can right click as many time as i want like a described at the beggining and everything works fine, with no crashes and expected behavior.
Don’t know if someone has encountered this issue and knows how to fix it, but any help would be appreciated!