Commit 7f60010
authored
fix: Prevent an exception in UTP when host disconnects (#1447)
The code was invoking the disconnect transport event callback on the
manager before doing some checks on UTP's NetworkConnection. But on a
client, that callback ends up calling Shutdown on the transport. This
disposes of the driver so the checks that follow end up throwing an
exception. The fix was to reorder the checks before the callback.
Also fix the logic that checked if there was a connection failure. It
was checking if the state of the connection was Connecting, but that's
never the case after a Disconnect event (the state will always be
Disconnected).1 parent e90791b commit 7f60010
File tree
2 files changed
+9
-6
lines changed- com.unity.netcode.adapter.utp
- Runtime
2 files changed
+9
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
13 | 14 | | |
14 | 15 | | |
15 | 16 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
435 | 435 | | |
436 | 436 | | |
437 | 437 | | |
438 | | - | |
439 | | - | |
440 | | - | |
441 | | - | |
442 | | - | |
443 | 438 | | |
444 | 439 | | |
445 | 440 | | |
446 | | - | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
447 | 444 | | |
448 | 445 | | |
449 | 446 | | |
450 | 447 | | |
451 | 448 | | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
452 | 454 | | |
453 | 455 | | |
454 | 456 | | |
| |||
0 commit comments