Skip to content

Commit c411130

Browse files
fix: tools metrics dispatcher related memory leak (#3427)
playModeStateChanged never gets unsubscribed in NetworkManager and keeps Multiplayer Tools MetricsDispatcher instances alive through NetworkMetrics when domain reload is disabled. Jira ticket: [MTT-11638](https://jira.unity3d.com/browse/MTT-11638) ## Changelog - Fixed: Memory leaks when domain reload is disabled. ## Testing and Documentation - No tests have been added. ## Backport Requires backport to v1.x. (#3428) --------- Co-authored-by: Noel Stephens <[email protected]>
1 parent 4fd19b4 commit c411130

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

com.unity.netcode.gameobjects/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ Additional documentation and release notes are available at [Multiplayer Documen
1313

1414
### Fixed
1515

16+
- Fixed memory leaks when domain reload is disabled. (#3427)
1617
- Fixed an exception being thrown when unregistering a custom message handler from within the registered callback. (#3417)
1718

1819
### Changed

com.unity.netcode.gameobjects/Runtime/Core/NetworkManager.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1629,6 +1629,10 @@ private void OnDestroy()
16291629
{
16301630
Singleton = null;
16311631
}
1632+
1633+
#if UNITY_EDITOR
1634+
EditorApplication.playModeStateChanged -= ModeChanged;
1635+
#endif
16321636
}
16331637

16341638
// Command line options

0 commit comments

Comments
 (0)