Skip to content

Commit bfc2bd5

Browse files
fix: tools metrics dispatcher related memory leak [Backport] (#3428)
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 This is a backport of #3427
1 parent 9687c8a commit bfc2bd5

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

com.unity.netcode.gameobjects/CHANGELOG.md

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

1717
### Fixed
1818

19+
- Fixed memory leaks when domain reload is disabled. (#3428)
1920
- Fixed issues with the `NetworkBehaviour` and `NetworkVariable` length safety checks. (#3415)
2021
- Fixed issue where during a `NetworkObject`'s spawn if you instantiated, spawned, and parented another network prefab under the currently spawning `NetworkObject` the parenting message would not properly defer until the parent `NetworkObject` was spawned. (#3403)
2122
- Fixed issue where in-scene placed `NetworkObjects` could fail to synchronize its transform properly (especially without a `NetworkTransform`) if their parenting changes from the default when the scene is loaded and if the same scene remains loaded between network sessions while the parenting is completely different from the original hierarchy. (#3388)

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1303,6 +1303,9 @@ private void OnDestroy()
13031303
{
13041304
Singleton = null;
13051305
}
1306+
#if UNITY_EDITOR
1307+
EditorApplication.playModeStateChanged -= ModeChanged;
1308+
#endif
13061309
}
13071310

13081311
// Command line options

0 commit comments

Comments
 (0)