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

@ -12,7 +12,7 @@
namespace Common {
namespace X64 {
class NativeClock : public WallClock {
class NativeClock final : public WallClock {
public:
NativeClock(u64 emulated_cpu_frequency, u64 emulated_clock_frequency, u64 rtsc_frequency);