Skip to content

Editor Crash when duplicating a GDExtension node if it have an internal child node event if it is added in constructor. #91023

@Daylily-Zeleen

Description

@Daylily-Zeleen

Tested versions

4.3dev[7529c0b]

System information

Windows 10, Vulkan, GTX1060

Issue description

Editor Crah when duplicating a GDExtension node(A) if it have an internal child node(B) event if it is added in constructor.
Because the flag data.in_constructor already be cleared when A adding B in A's constructor.

This can be fixed by #91019 or #91018.

Steps to reproduce

  1. Create a GDExtension node which have an internal node, for example:
class MyNode : public Node {
	GDCLASS(MyNode, Node)

	Node *child;

protected:
	static void _bind_methods() {}

public:
	MyNode() {
		child = memnew(Node);
		add_child(child);
	}
};
  1. Add a MyNode node in editor node tree. than duplicate this node.
  2. The editor will crash.

Please download the attached file for testing, the test project is in test_project folder.
If you are not using windows, please compile GDExtension plugin by youself.

Minimal reproduction project (MRP)

bug report.zip

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions