You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When a network list is declared public sometimes as part of the serialisation process it looks like the list is instantiated, or at least partially, but it's never disposed leading to a Leak Detected message on the next recompile or play through. The list doesn't appear usable unless Initialise is called on it. Due to this instantiation there's no requirement for your own in Awake but if there is one it has no effect on this.
Public NetworkVariables are also auto instantiated but show no ill effects.
Description
When a network list is declared public sometimes as part of the serialisation process it looks like the list is instantiated, or at least partially, but it's never disposed leading to a Leak Detected message on the next recompile or play through. The list doesn't appear usable unless Initialise is called on it. Due to this instantiation there's no requirement for your own in Awake but if there is one it has no effect on this.
Public NetworkVariables are also auto instantiated but show no ill effects.
Reproduce Steps
There's a discussion and code example here.
Actual Outcome
Leak log - Leak Detected : Persistent allocates 4 individual allocations.
Expected Outcome
Public network lists are not auto instantiated.
Environment
Additional Context
Having a network list public seems to be the only way to see the contents of the list in the inspector as it won't show with [SerializeField].
This issue is also mentioned in #2862.
The text was updated successfully, but these errors were encountered: