Skip to content

Commit aa48192

Browse files
danbevtargos
authored andcommitted
inspector: add virtual destructor to WorkerDelegate
Currently the WorkerDelegate class has a virtual function but no virtual destructor which means that if delete is called on a WorkerDelegate 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 'node::inspector::WorkerDelegate' that is abstract but has 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 db8d99d commit aa48192

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/inspector/worker_inspector.h

+1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ class WorkerDelegate {
2121
const std::string& url,
2222
bool waiting,
2323
std::shared_ptr<MainThreadHandle> worker) = 0;
24+
virtual ~WorkerDelegate() {}
2425
};
2526

2627
class WorkerManagerEventHandle {

0 commit comments

Comments
 (0)