Closed RhapsodyInGeek closed 2 years ago
How did you figure out it crashes in get_as_text
? Did you put prints? Did you attach a C++ debugger and it stopped at the line with get_as_text
? (careful depending on the debugger it might point the line after the offending line) Did you get a crash dump with the call stack mentionning get_as_text
?
I literally isolated the call. It's not a very large function, and it only crashes when including that call to get_as_text
. I first encountered it when trying JSON::get_singleton()->parse(file->get_as_text())
, and then attempted to run the same code in GDScript with success there. It only happens when calling it with GDNative.
Resolved by erasing the cpp + header files from disk, redownloading the latest 3.5 cpp + header repos, and rebuilding them. Everything works again. Not sure what happened since I never touched the source files, but I'll take it.
Godot version
3.5 Stable
System information
Windows 10
Issue description
EDIT: Fixed by erasing the cpp + header bindings on my disk, downloading the latest 3.5 bindings, and rebuilding them. Currently working again. Not sure what happened since I didn't touch any of the binding source files.
I'm attempting to read a JSON file through GDNative, but the game crashes on runtime. I recreated the code in GDScript and had no issues. It could be possible that I'm doing something wrong, but the fact that the exact code works in GDScript isn't convincing.
Steps to reproduce
Functional GDScript:
Non-functional GDNative:
Crashes upon calling
get_as_text()
when using the GDNative class._ready()
method is declared in_register_methods()
and code functions upon omitting / replacingget_as_text()
.Minimal reproduction project
No response