Fix unsafe uses of Callable.is_null()

`Callable.is_null()` is not equivalent to `!Callable.is_valid()` and
doesn't guarantee the call is valid.
This commit is contained in:
A Thousand Ships 2024-04-27 11:56:39 +02:00
parent 6118592c6d
commit 31e7ee63f2
No known key found for this signature in database
GPG key ID: 2033189A662F8BD7
19 changed files with 40 additions and 40 deletions

View file

@ -2106,7 +2106,7 @@ void RendererCanvasCull::update_visibility_notifiers() {
if (visibility_notifier->just_visible) {
visibility_notifier->just_visible = false;
if (!visibility_notifier->enter_callable.is_null()) {
if (visibility_notifier->enter_callable.is_valid()) {
if (RSG::threaded) {
visibility_notifier->enter_callable.call_deferred();
} else {
@ -2117,7 +2117,7 @@ void RendererCanvasCull::update_visibility_notifiers() {
if (visibility_notifier->visible_in_frame != RSG::rasterizer->get_frame_number()) {
visibility_notifier_list.remove(E);
if (!visibility_notifier->exit_callable.is_null()) {
if (visibility_notifier->exit_callable.is_valid()) {
if (RSG::threaded) {
visibility_notifier->exit_callable.call_deferred();
} else {