RFR: 8263840: PeriodicTask should declare its destructor virtual
Kim Barrett
kbarrett at openjdk.java.net
Fri Jul 23 07:59:05 UTC 2021
On Fri, 23 Jul 2021 07:20:48 GMT, David Holmes <dholmes at openjdk.org> wrote:
> Please review this trivial fix.
>
> Testing tiers 1-3 as sanity check
>
> Thanks,
> David
Looks good, and trivial.
For the record, the destructor could (currently) instead be left non-virtual but made protected, and that would also prevent slicing. All places that currently destroy a periodic task do so using a derived class pointer, so the base class destructor doesn't need to be public. But this class seems like one that might someday have clients that destroy using a base class pointer. Indeed, there seem to be some tasks that presently never get destroyed at all, like the ChunkPoolCleaner.
-------------
Marked as reviewed by kbarrett (Reviewer).
PR: https://git.openjdk.java.net/jdk/pull/4886
More information about the hotspot-runtime-dev
mailing list