-
-
Notifications
You must be signed in to change notification settings - Fork 589
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Custom GDNative class as class variable triggers crash #322
Comments
The problem with structuring it like this is that Godot looses the ability to reference count the object and destroys it before its ready. You need to define next_state as a Ref as well and then call instance on it to create it:
When you did |
Is this issue fixed? (tbh there are others like this which don't seem to be issues with Godot-Cpp but more like questions/troubleshootings which are still hanging around) |
I have one GDNative object listed as a property of another. When returning a pointer to the property or casting said pointer to a reference, the engine crashes.
However, if I initialize a new instance and copy the values over, it works as intended. Unfortunately, my workaround creates a drain on performance. Perhaps Godot only has access to the heap?
C++ code:
Backtrace:
The text was updated successfully, but these errors were encountered: