mirror of
https://github.com/nodejs/node.git
synced 2026-11-26 21:58:26 -05:00
src: add virtual desctructor to Options class
Currently the Options class has a virtual function but no virtual
destructor which means that if delete is called on a Options pointer
to a derived instance, the derived destructor will not get called.
The following warning is currently being printed when
compiling:
warning: delete called on non-final 'node::PerIsolateOptions' that has
virtual functions but non-virtual destructor [-Wdelete-non-virtual-dtor]
delete __ptr;
This commit adds a virtual destructor.
PR-URL: https://github.com/nodejs/node/pull/23215
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
1 parent
27c5e96ffe
commit
894210ec12
1 file changed
+1
@@ -24,6 +24,7 @@ struct HostPort {
|
||||
class Options {
|
||||
public:
|
||||
virtual void CheckOptions(std::vector<std::string>* errors) {}
|
||||
virtual ~Options() {}
|
||||
};
|
||||
|
||||
// These options are currently essentially per-Environment, but it can be nice
|
||||
|
||||
Reference in new issue
Block a user