1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-11 04:56:01 +01:00

Prevent overriding virtual methods that are called in a destructor

Virtual methods are no longer valid once the derived destructor has
run. This means the compiler is free to optimize them to be
non-virtual.

Found using clang-tidy
This commit is contained in:
Yorick van Pelt 2023-08-11 11:58:33 +02:00
parent a1fdc68c65
commit b9b51f9579
No known key found for this signature in database
GPG key ID: D8D3CC6D951384DE
3 changed files with 7 additions and 3 deletions

View file

@ -108,7 +108,8 @@ public:
stop();
}
void stop() override
/* Called by destructor, can't be overridden */
void stop() override final
{
{
auto state(state_.lock());