mirror of
https://github.com/NixOS/nix
synced 2025-06-27 21:01:16 +02:00
fix(libutil/config): declare virtual dtor for AbstractConfig
This prevents any potential cases of deletion through base pointer and its non-virtual dtor, which might leak memory. Also gets rid of the warning: /nix/store/fg7ass3a5m5pgl26qzfdniicbwbgzccy-gcc-13.2.0/include/c++/13.2.0/bits/stl_construct.h:88:2: warning: destructor called on non-final 'nix::flake::Settings' that has virtual functions but non-virtual destructor [-Wdelete-non-abstract-non-virtual-dtor] 88 | __location->~_Tp(); .... ../src/libflake-c/nix_api_flake.cc:10:30: note: in instantiation of function template specialization 'nix::make_ref<nix::flake::Settings>' requested here 10 | auto settings = nix::make_ref<nix::flake::Settings>();
This commit is contained in:
parent
4fc5295328
commit
f9980b5715
1 changed files with 2 additions and 0 deletions
|
@ -115,6 +115,8 @@ public:
|
|||
* Re-applies all previously attempted changes to unknown settings
|
||||
*/
|
||||
void reapplyUnknownSettings();
|
||||
|
||||
virtual ~AbstractConfig() = default;
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue