Closed ricrogz closed 1 year ago
Turns out I completely misunderstood what's going on here.
Ok, should be fixed now.
The issue was happening only when we exited the method early. Fixed by moving the allocation of the pointer to happen after the early exit. The pointer doesn't need to be deleted, since the sketcherMinimizer
will take care of it.
I was running asan on RDKit's test when I noticed this leak:
This is coming from
auto* minMol = new sketcherMinimizerMolecule;
, which was never being deleted. This fixes the issue by allocating the sketcherMinimizerMolecule on the stack, so that it gets destroyed when it goes out of scope at the end of the function.I'm not adding a test because this is checked in RDKit, and I don't know how to trigger this issue from bare coordgen.