Skip to main content
Minor formatting fixes
Source Link
liggiorgio
  • 5.5k
  • 6
  • 27
  • 38

I have a NativeArray which stays alive during the whole game, using the Persistent allocator. Should I dispose it inside an OnApplicationQuit callback?

OnIn the editor, Unity gives me athe following leak detection error as follows after I restart playmodePlay Mode:

A Native Collection has not been disposed, resulting in a memory leak. Allocated from:...

I don't understand how I can be causing a memory leak after my application quits. Is the OS not reclaiming everything already?

I have a NativeArray which stays alive during the whole game, using the Persistent allocator. Should I dispose it inside an OnApplicationQuit callback?

On the editor, Unity gives me a leak detection error as follows after I restart playmode:

A Native Collection has not been disposed, resulting in a memory leak. Allocated from:...

I don't understand how I can be causing a memory leak after my application quits. Is the OS not reclaiming everything already?

I have a NativeArray which stays alive during the whole game, using the Persistent allocator. Should I dispose it inside an OnApplicationQuit callback?

In the editor, Unity gives me the following leak detection error after I restart Play Mode:

A Native Collection has not been disposed, resulting in a memory leak. Allocated from:...

I don't understand how I can be causing a memory leak after my application quits. Is the OS not reclaiming everything already?

Source Link
starikcetin
  • 5.3k
  • 4
  • 27
  • 60

Should I dispose a NativeArray on application quit?

I have a NativeArray which stays alive during the whole game, using the Persistent allocator. Should I dispose it inside an OnApplicationQuit callback?

On the editor, Unity gives me a leak detection error as follows after I restart playmode:

A Native Collection has not been disposed, resulting in a memory leak. Allocated from:...

I don't understand how I can be causing a memory leak after my application quits. Is the OS not reclaiming everything already?