Closed njnobles closed 4 months ago
Hi @parrt, would it be possible to get someone to review this PR? Thank you!
Unfortunately I'm not qualified to evaluate this :( Maybe @mike-lischke ? @jcking ?
Thanks, @mike-lischke !
Thank you, @parrt and @mike-lischke!
This PR fixes memory leaks caused by the StaticData objects associated with the generated Parser and Lexer classes.
Found using the CRT library in VS2022. With the demo project, it produces a leak report similar to this:
Valgrind on Ubuntu produces a similarly large leak detection.
Switching the StaticData objects to be unique_ptr instead of raw pointers removes all but 1 leak. The remaining leak is the ATNDeserializationOptions which is also fixed by a unique_ptr.