-
-
Notifications
You must be signed in to change notification settings - Fork 21.5k
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
Fix RefCounted.unreference()
documentation providing wrong info.
#82557
Conversation
RefCounted.unreference()
documentation providing wrong info.
The docs are wrong, but the suggested description is not accurate either |
Yeah but then it notifies the script of |
Either you or me are missing something. Can you please show your point with a piece of GDScript or C++? Code will act as a universal language. |
I tested it with the code below extends RefCounted
class_name TestRefCounted
func _notification(what):
if self == null: return
if what == NOTIFICATION_PREDELETE:
print("Attempt to delete refcounted!")
cancel_free() extends Node
func _ready():
var ref:=TestRefCounted.new()
var weakref:WeakRef=weakref(ref)
print(ref.get_reference_count())
ref = null
ref = weakref.get_ref()
print(ref) This doesnt even send a notification to delete it... |
Thanks for the sample! A couple of thoughts:
|
Updated it. is it fine now? |
The only pending thing would be squashing the four commits into one. See https://docs.godotengine.org/en/stable/contributing/workflow/pr_workflow.html#the-interactive-rebase. |
... i thought that github does that automatically no? |
Only if using the "Squash and Merge" feature, but we don't use it for a number of reasons. We prefer that PRs get squashed before merge. |
Done |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for handling the feedback with patience.
For the record, your commit seems not to be linked to your GitHub account. See: Why are my commits linked to the wrong user? for more info. |
Yeah i know about that issue thanks! |
Thanks! And congrats for your first merged Godot contribution 🎉 |
Cherry-picked for 4.1.3. |
No description provided.