Fix VisibilityEnabler2D throwing a signal error when process_parent or physics_process_parent are enabled

This commit is contained in:
Laurenz Reinthaler 2021-09-24 19:00:11 +02:00
parent c26547414d
commit aad01cd0c6

View file

@ -242,11 +242,11 @@ void VisibilityEnabler2D::_notification(int p_what) {
if (enabler[ENABLER_PARENT_PHYSICS_PROCESS] && get_parent()) {
get_parent()->connect(SceneStringNames::get_singleton()->ready,
get_parent(), "set_physics_process", varray(false), CONNECT_ONESHOT);
get_parent(), "set_physics_process", varray(false), CONNECT_REFERENCE_COUNTED);
}
if (enabler[ENABLER_PARENT_PROCESS] && get_parent()) {
get_parent()->connect(SceneStringNames::get_singleton()->ready,
get_parent(), "set_process", varray(false), CONNECT_ONESHOT);
get_parent(), "set_process", varray(false), CONNECT_REFERENCE_COUNTED);
}
}