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

Fix: Prevent PackedScene duplicate signal connection for CONNECT_PERSIST #103846

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Andrewyuan34
Copy link

Fix: Prevent PackedScene duplicate signal connection for CONNECT_PERSIST occured in issue #103453

Issue

  • When a PackedScene is instantiated, it automatically restores CONNECT_PERSIST signals.
  • However, if SceneState::instantiate calls connect(), it triggers a "Signal already connected" error.

Solution

  • Modified Object::connect() to check for CONNECT_PERSIST before reporting duplicate connections.
  • If the signal is already connected and has CONNECT_PERSIST, it will skip reconnection instead of throwing an error.

Note:
This is my first PR to the Godot project. If there are any issues or areas for improvement, please let me know—I’m happy to make adjustments and learn from your feedback! Thank you for your patience and guidance.

@Andrewyuan34 Andrewyuan34 requested a review from a team as a code owner March 9, 2025 02:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant