diff --git a/com.unity.netcode.gameobjects/CHANGELOG.md b/com.unity.netcode.gameobjects/CHANGELOG.md index db93801f9a..e8a80939f1 100644 --- a/com.unity.netcode.gameobjects/CHANGELOG.md +++ b/com.unity.netcode.gameobjects/CHANGELOG.md @@ -30,6 +30,7 @@ Additional documentation and release notes are available at [Multiplayer Documen ### Fixed +- Removed allocation to the heap in NetworkBehaviourUpdate. (#3573) - Fixed issue where NetworkConfig.ConnectionData could cause the ConnectionRequestMessage to exceed the transport's MTU size and would result in a buffer overflow error. (#3564) - Fixed regression issue in v2.x where `NetworkObject.GetNetworkBehaviourAtOrderIndex` was converted from public to internal. (#3541) - Fixed ensuring OnValueChanged callback is still triggered on the authority when a collection changes and then reverts to the previous value in the same frame. (#3539) diff --git a/com.unity.netcode.gameobjects/Runtime/Core/NetworkBehaviourUpdater.cs b/com.unity.netcode.gameobjects/Runtime/Core/NetworkBehaviourUpdater.cs index 105f203c86..943257dd74 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 dirtyNetworkObject in m_PendingDirtyNetworkObjects) + { + m_DirtyNetworkObjects.Add(dirtyNetworkObject); + } m_PendingDirtyNetworkObjects.Clear(); // NetworkObject references can become null, when hidden or despawned. Once NUll, there is no point