Skip to content

Commit 6761547

Browse files
fix: Stop autoconnect thread on quit (#522)
Co-authored-by: Tamás Gálffy <[email protected]>
1 parent 7c1e9ef commit 6761547

File tree

5 files changed

+7
-5
lines changed

5 files changed

+7
-5
lines changed

addons/netfox.extras/network-simulator.gd

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ var _enet_peer: ENetMultiplayerPeer = ENetMultiplayerPeer.new()
4141

4242
# UDP proxy
4343
var _proxy_thread: Thread
44+
var _proxy_loop_enabled := true
4445
var _udp_proxy_server: PacketPeerUDP
4546
var _udp_proxy_port: int
4647
var _rng_packet_loss: RandomNumberGenerator = RandomNumberGenerator.new()
@@ -138,7 +139,7 @@ func _process_packets() -> void:
138139
_process_server_to_client_queue(send_threshold)
139140

140141
func _process_loop():
141-
while true:
142+
while _proxy_loop_enabled:
142143
_process_packets()
143144
OS.delay_msec(1)
144145

@@ -233,4 +234,5 @@ func _should_send_packet() -> bool:
233234

234235
func _exit_tree() -> void:
235236
if _proxy_thread and _proxy_thread.is_started():
237+
_proxy_loop_enabled = false
236238
_proxy_thread.wait_to_finish()

addons/netfox.extras/plugin.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@
33
name="netfox.extras"
44
description="Game-specific utilities for Netfox"
55
author="Tamas Galffy and contributors"
6-
version="1.33.1"
6+
version="1.33.2"
77
script="netfox-extras.gd"

addons/netfox.internals/plugin.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@
33
name="netfox.internals"
44
description="Shared internals for netfox addons"
55
author="Tamas Galffy and contributors"
6-
version="1.33.1"
6+
version="1.33.2"
77
script="plugin.gd"

addons/netfox.noray/plugin.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@
33
name="netfox.noray"
44
description="Bulletproof your connectivity with noray integration for netfox"
55
author="Tamas Galffy and contributors"
6-
version="1.33.1"
6+
version="1.33.2"
77
script="netfox-noray.gd"

addons/netfox/plugin.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@
33
name="netfox"
44
description="Shared internals for netfox addons"
55
author="Tamas Galffy and contributors"
6-
version="1.33.1"
6+
version="1.33.2"
77
script="netfox.gd"

0 commit comments

Comments
 (0)