-
-
Notifications
You must be signed in to change notification settings - Fork 18.8k
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
Variant's reference count is inconsistent #64813
Comments
This is not a bug. The first time |
@neikeq What is the usage of |
The initial Why not make |
We could add a debug-only check in |
I'm making JavaScript language binding when pass a RefCounted back as an Variant the referece count is decrease in this situation. |
If you want to be safe, just call |
Godot version
4.0 alpha11
System information
Linux x64
Issue description
Variant
with aRefCounted
pointer but decreased by the destructor.RefCounted
to aVariant
I'm confused about the implementation of the constructor
Variant::Variant(const Object *p_object)
. Can someone help me explain the intent of this code ?godot/core/variant/variant.cpp
Lines 2692 to 2699 in b438859
Steps to reproduce
The numbers annotated in the sample code below are the reference counts I expect
The results are not consistent with what I expected
Minimal reproduction project
No response
The text was updated successfully, but these errors were encountered: