You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When a node connects to a Signal created in an Autoload through C#s EventHandler, it continues to receive that signal after it has been freed. This can cause unintended behavior and ObjectDisposedExceptions.
The signal is disconnected when the 'Connect' function is used with a Callable.
#66319 is very related, and a possible jumping off point, although it was fixed a year ago.
Steps to reproduce
Create a signal in a script that is used in an Autoload.
Have a condition in the same Autoload script to emit the signal.
In another script, use C#s += to connect the signal to a function.
Free the second script.
Repeat the condition in the Autoload that emits the signal.
Minimal reproduction project
Run the included SignalTest project from Scene 1.
Click anywhere, three signal debugs should print.
Press enter to change to another scene.
Click anywhere, no signal debugs should print, but one does.
Godot version
v4.1.1.stable.mono.official.bd6af8e0e
System information
Windows 10.0.19045 - Vulkan (Mobile) - dedicated NVIDIA GeForce GTX 970 (NVIDIA; 31.0.15.3623) - Intel(R) Core(TM) i7-6700 CPU @ 3.40GHz (8 Threads)
Issue description
When a node connects to a Signal created in an Autoload through C#s EventHandler, it continues to receive that signal after it has been freed. This can cause unintended behavior and ObjectDisposedExceptions.
The signal is disconnected when the 'Connect' function is used with a Callable.
#66319 is very related, and a possible jumping off point, although it was fixed a year ago.
Steps to reproduce
Create a signal in a script that is used in an Autoload.
Have a condition in the same Autoload script to emit the signal.
In another script, use C#s += to connect the signal to a function.
Free the second script.
Repeat the condition in the Autoload that emits the signal.
Minimal reproduction project
Run the included SignalTest project from Scene 1.
Click anywhere, three signal debugs should print.
Press enter to change to another scene.
Click anywhere, no signal debugs should print, but one does.
SignalTest.zip
The text was updated successfully, but these errors were encountered: