summaryrefslogtreecommitdiff
path: root/platform/android/net_socket_android.cpp
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2022-02-16 16:55:07 +0100
committerGitHub <noreply@github.com>2022-02-16 16:55:07 +0100
commit51a00c2855009ce4cd6475c09209ebd22641f448 (patch)
tree56b249dbe446b5e24946c16ee13bd8241a119de6 /platform/android/net_socket_android.cpp
parent33c7f52f361961c64432cfd772909ed3ba76cd51 (diff)
parentb8b45804485f7ca18f035f1eeb7a1ac0cf591cac (diff)
Merge pull request #58182 from akien-mga/style-cleanup-if-semicolons-deadcode
Diffstat (limited to 'platform/android/net_socket_android.cpp')
-rw-r--r--platform/android/net_socket_android.cpp21
1 files changed, 14 insertions, 7 deletions
diff --git a/platform/android/net_socket_android.cpp b/platform/android/net_socket_android.cpp
index 620df539e4..a65e7c6724 100644
--- a/platform/android/net_socket_android.cpp
+++ b/platform/android/net_socket_android.cpp
@@ -77,18 +77,21 @@ NetSocketAndroid::~NetSocketAndroid() {
void NetSocketAndroid::close() {
NetSocketPosix::close();
- if (wants_broadcast)
+ if (wants_broadcast) {
multicast_lock_release();
- if (multicast_groups)
+ }
+ if (multicast_groups) {
multicast_lock_release();
+ }
wants_broadcast = false;
multicast_groups = 0;
}
Error NetSocketAndroid::set_broadcasting_enabled(bool p_enabled) {
Error err = NetSocketPosix::set_broadcasting_enabled(p_enabled);
- if (err != OK)
+ if (err != OK) {
return err;
+ }
if (p_enabled != wants_broadcast) {
if (p_enabled) {
@@ -105,11 +108,13 @@ Error NetSocketAndroid::set_broadcasting_enabled(bool p_enabled) {
Error NetSocketAndroid::join_multicast_group(const IPAddress &p_multi_address, String p_if_name) {
Error err = NetSocketPosix::join_multicast_group(p_multi_address, p_if_name);
- if (err != OK)
+ if (err != OK) {
return err;
+ }
- if (!multicast_groups)
+ if (!multicast_groups) {
multicast_lock_acquire();
+ }
multicast_groups++;
return OK;
@@ -117,14 +122,16 @@ Error NetSocketAndroid::join_multicast_group(const IPAddress &p_multi_address, S
Error NetSocketAndroid::leave_multicast_group(const IPAddress &p_multi_address, String p_if_name) {
Error err = NetSocketPosix::leave_multicast_group(p_multi_address, p_if_name);
- if (err != OK)
+ if (err != OK) {
return err;
+ }
ERR_FAIL_COND_V(multicast_groups == 0, ERR_BUG);
multicast_groups--;
- if (!multicast_groups)
+ if (!multicast_groups) {
multicast_lock_release();
+ }
return OK;
}