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 <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Joyee Cheung <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: James M Snell <[email protected]>
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

+1
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)