common/wall_clock: Add virtual destructors

From -fsanitize=address, this code wasn't calling the proper destructor.
Adding virtual destructors for each inherited class and the base class
fixes this bug.

While we are at it, mark the functions as final.
This commit is contained in:
ReinUsesLisp 2020-09-29 16:19:37 -03:00
parent e61d8de5f6
commit a66d8bb49d
3 changed files with 4 additions and 2 deletions

View file

@ -13,6 +13,8 @@ namespace Common {
class WallClock {
public:
virtual ~WallClock() = default;
/// Returns current wall time in nanoseconds
[[nodiscard]] virtual std::chrono::nanoseconds GetTimeNS() = 0;