Unity Issue Tracker - EntityManager.CreateSingleton<T>() method creates a memory leak when Reloading Domain
Closed
ECSB-445
EntityManager.CreateSingleton<T>() method creates a memory leak when Reloading Domain
Package: Entity Component System (ECS)
Won't Fix
1.0.X
If this is fixed, it will be fixed in a later version.
How to reproduce:
1. Open the “CreateSingleton_DomainReload_Bug“ project
2. Change “Leak Detection Level” to “Enabled With Stack Trace” (Edit > Preferences > Jobs)
3. Open the “SampleScene”
4. Enter Play Mode and wait until “singleton create” is logged to Console then exit Play Mode
5. Open the “SomeSystem” Script Asset and add a newline at the end of the file then save it
6. Return to Editor and wait for Domain Reload then observe the Console
Expected result: no messages are logged
Actual result: “Found 1 leak(s) from callstack” message is logged
Notes:
1. Full message log in internal comments
2. Setting “Leak Detection Level” to “Enabled” logs multiple “Found 1 leak(s) from callstack” messages mostly pointing to the same memory address
Prioritise and Follow this issue
Have a workaround or additional info about this issue?