godotengine / godot-cpp

C++ bindings for the Godot script API
MIT License
1.69k stars 527 forks source link

Remind developers about `memnew()` in crash message when missing binding callbacks #1510

Closed dsnopek closed 2 months ago

dsnopek commented 3 months ago

New developers not knowing the need to use memnew() instead of new is a common cause for support requests.

After PR https://github.com/godotengine/godot-cpp/pull/1446, Godot will crash if a developer forgot to use memnew().

This PR attempts to improve that message by mentioning memnew(), in order to help folks learn about it, and hopefully reduce the number of support requests related to it. :-)

This also removes the ERR_PRINT() that duplicates the message - I'm not sure why that was there, but I don't think it should be necessary.