Open
Description
Godot version
4.3.dev(11d3768)
godot-cpp version
4.3.dev(e23b117)
System information
win11
Issue description
This issue have existed for a long time, The reproduction steps are the same as this comment: #358 (comment).
String s; // crashes
class SomeClass {
static Dictionary d; // crashes
static Node *singleton; // fine, pointer doesn't call a constructor
};
This issue is quite tricky, as it is caused by godot load gdextension .dll and initializate GDExtensionInterface
order.
Do need to solve this problem?
Steps to reproduce
// world.h
const String level0 = "res://level/level0.tscn"; // load gdextension.dll will call String constructor, but this time gdextension function didnt initialized
class World : public Node {
GDCLASS(World, Node)
static void _bind_methods() {}
};
Define a global variable String
, open godot.exe timeline:
- start open godot.exe
- godot.exe: Load gdextension.dll -> dll: global variable Construct -> dll: call
String
construct GDExtensionInterface(not initialzed and will Crash) - godot.exe: initialize gdextension.dll GDExtensionInterface
Minimal reproduction project
N/A