Skip to content
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

CONNECT_REFERENCE_COUNTED/connect documentation does not give important information #4473

Open
chess123mate opened this issue Dec 22, 2020 · 1 comment
Labels
area:class reference Issues and PRs about the class reference, which should be addressed on the Godot engine repository enhancement

Comments

@chess123mate
Copy link

Godot version: v3.2.3.stable.official

URL to the documentation page: https://docs.godotengine.org/en/stable/classes/class_object.html (under connect)

It fails to indicate some things that resulted in great confusion as someone trying to learn godot. When using CONNECT_REFERENCE_COUNTED:

  • The binds parameter in the connect function is only used in the first connection
  • Even when using CONNECT_REFERENCE_COUNTED, it will only fire a target/method pair once

Further, the connect documentation claims that:

It will throw an error if already connected, unless the signal was connected with CONNECT_REFERENCE_COUNTED

However, this is not fully true: if you call connect the 2nd time with CONNECT_REFERENCE_COUNTED, it won't error, even if you did not use CONNECT_REFERENCE_COUNTED for the first connection.

@Mickeon
Copy link
Contributor

Mickeon commented Nov 12, 2022

Does godotengine/godot#67880 solve this issue?
https://github.com/godotengine/godot/blob/3c97a87457cee83b9725f179e198d6c801b85f12/doc/classes/Object.xml#L784-L786

Reference-counted connections can be assigned to the same [Callable] multiple times. Each disconnection decreases the internal counter. The signal fully disconnects only when the counter reaches 0.

@skyace65 skyace65 added the area:class reference Issues and PRs about the class reference, which should be addressed on the Godot engine repository label Dec 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:class reference Issues and PRs about the class reference, which should be addressed on the Godot engine repository enhancement
Projects
None yet
Development

No branches or pull requests

3 participants