diff --git a/com.unity.netcode.gameobjects/CHANGELOG.md b/com.unity.netcode.gameobjects/CHANGELOG.md index 7fdab72391..ea57b68a2a 100644 --- a/com.unity.netcode.gameobjects/CHANGELOG.md +++ b/com.unity.netcode.gameobjects/CHANGELOG.md @@ -14,6 +14,7 @@ Additional documentation and release notes are available at [Multiplayer Documen ### Fixed +- Removed allocation to the heap in NetworkBehaviourUpdate. (#3568) - Fixed issue where NetworkConfig.ConnectionData could cause the ConnectionRequestMessage to exceed the transport's MTU size and would result in a buffer overflow error. (#3565) ### Changed diff --git a/com.unity.netcode.gameobjects/Runtime/Core/NetworkBehaviourUpdater.cs b/com.unity.netcode.gameobjects/Runtime/Core/NetworkBehaviourUpdater.cs index 524f6a2025..beb540891b 100644 --- a/com.unity.netcode.gameobjects/Runtime/Core/NetworkBehaviourUpdater.cs +++ b/com.unity.netcode.gameobjects/Runtime/Core/NetworkBehaviourUpdater.cs @@ -34,7 +34,10 @@ internal void NetworkBehaviourUpdate(bool forceSend = false) #endif try { - m_DirtyNetworkObjects.UnionWith(m_PendingDirtyNetworkObjects); + foreach (var o in m_PendingDirtyNetworkObjects) + { + m_DirtyNetworkObjects.Add(o); + } m_PendingDirtyNetworkObjects.Clear(); // NetworkObject references can become null, when hidden or despawned. Once NUll, there is no point