INetworkSerialization issues with NativeArrays and NativeLists. #3071
Labels
Investigating
Issue is currently being investigated
stat:awaiting triage
Status - Awaiting triage from the Netcode team.
type:bug
Bug Report
Description
NativeArrays seem to throw a memory leak error if I attempt to serialize the class using them with INetworkSerializable.
NetworkSerialize with a NativeArray and setting the Allacator.Persistent will throw this memory leak issue.
`
public class TestActionSystem : INetworkSerializable, IDisposable
{
`
NativeArrays with a custom struct also break if that custom struct impliments INetworkSerializable. If i dont add that interface and or serialize using the methods here it does work.
NativeLists dont even appear to work. I tried the simplest version with just ints, and this didn't work .
`
public class TestActionSystem : INetworkSerializable, IDisposable
{
`
My goal is hopefully just use a NativeList with my own custom structs with a few more NativeLists inside (to get around the issue of directly nesting NativeLists with other NativeLists.
But I can't even get the NativeArrays to work without a memory leak, and the NativeLists to even serialize.
Reproduce Steps
Provided in description
Actual Outcome
NativeArray with a int fires a memory leak exception. (needs to work with custom structs)
NativeList with a int won't even serailize.
Expected Outcome
NativeArray doesn't fire memory leak
NativeList serailizes on the network.
Screenshots
If applicable, add screenshots to help explain your problem.
Environment
Additional Context
Add any other context about the problem here. Logs, code snippets would be useful here but please also consider attaching a minimal Unity project that reproduces the issue.
The text was updated successfully, but these errors were encountered: