Skip to content

Commit 894210e

Browse files
danbevtargos
authored andcommitted
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: #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>
1 parent 27c5e96 commit 894210e

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/node_options.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ struct HostPort {
2424
class Options {
2525
public:
2626
virtual void CheckOptions(std::vector<std::string>* errors) {}
27+
virtual ~Options() {}
2728
};
2829

2930
// These options are currently essentially per-Environment, but it can be nice

0 commit comments

Comments
 (0)