By observing class count in the script profiler UI, in a static function, returning a newly created instance of a class and invoking a method returning that instance in the same return statement causes a memory leak.
Same behaviour has been observed for both managed and non-managed classes.
Description
Description
Details
Details
- Severity
- Minor
- Resolution
- Open
- Reproducibility
- Always
- Operating System
- Windows 10 x64
- Category
- General
Steps To Reproduce
- Declare the following class
class LeakTest { static LeakTest leak() { return (new LeakTest()).getThis(); } LeakTest getThis() { return this; } }
- Invoke leak()
- Observe LeakTest instances count
Additional Information
Tested with experimental build, DayZDiag.exe 1.21.156073