diff options
author | Rémi Verschelde <remi@verschelde.fr> | 2022-02-15 20:48:18 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-15 20:48:18 +0100 |
commit | 98b97d34df7f3ab2cafc3847358c231c3d357b40 (patch) | |
tree | 431aa6f107e860aa1e1f4ae8864f9b06e8ace169 /scene/main/http_request.cpp | |
parent | 6d575873969609e6ed58dee5052d23512b104498 (diff) | |
parent | 0f5455230c8955be0c6533574bd3d5b6f50792b6 (diff) |
Merge pull request #58151 from akien-mga/notification-switch-scene
Diffstat (limited to 'scene/main/http_request.cpp')
-rw-r--r-- | scene/main/http_request.cpp | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/scene/main/http_request.cpp b/scene/main/http_request.cpp index 4e91548d14..700ba761f6 100644 --- a/scene/main/http_request.cpp +++ b/scene/main/http_request.cpp @@ -464,20 +464,22 @@ void HTTPRequest::_request_done(int p_status, int p_code, const PackedStringArra } void HTTPRequest::_notification(int p_what) { - if (p_what == NOTIFICATION_INTERNAL_PROCESS) { - if (use_threads.is_set()) { - return; - } - bool done = _update_connection(); - if (done) { - set_process_internal(false); - } - } + switch (p_what) { + case NOTIFICATION_INTERNAL_PROCESS: { + if (use_threads.is_set()) { + return; + } + bool done = _update_connection(); + if (done) { + set_process_internal(false); + } + } break; - if (p_what == NOTIFICATION_EXIT_TREE) { - if (requesting) { - cancel_request(); - } + case NOTIFICATION_EXIT_TREE: { + if (requesting) { + cancel_request(); + } + } break; } } |