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:
parent
a1fdc68c65
commit
b9b51f9579
3 changed files with 7 additions and 3 deletions
|
|
@ -108,7 +108,8 @@ public:
|
|||
stop();
|
||||
}
|
||||
|
||||
void stop() override
|
||||
/* Called by destructor, can't be overridden */
|
||||
void stop() override final
|
||||
{
|
||||
{
|
||||
auto state(state_.lock());
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue