dthuerck / mapmap_cpu

A high-performance general-purpose MRF MAP solver, heavily exploiting SIMD instructions.
BSD 3-Clause "New" or "Revised" License
102 stars 51 forks source link

Possible memory leak in TreeSampler #10

Closed h00shi closed 6 years ago

h00shi commented 6 years ago

In tree_sample.h at line 27 the destructor is not defined as virtual: ~TreeSampler();

This will prevent the destructors of the child classes, i.e., LockFreeTreeSample and OptimisticTreeSampler, to be called, when they are stored in something such as std::unique_ptr<TreeSampler>. Which I am quite sure that causes memory leaks.