From aa48192f9da1ba01190f68f16d00763123ec5cf0 Mon Sep 17 00:00:00 2001 From: Daniel Bevenius Date: Tue, 2 Oct 2018 12:03:27 +0200 Subject: [PATCH] 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: https://github.com/nodejs/node/pull/23215 Reviewed-By: Ben Noordhuis Reviewed-By: Colin Ihrig Reviewed-By: Joyee Cheung Reviewed-By: Benjamin Gruenbaum Reviewed-By: Anna Henningsen Reviewed-By: James M Snell --- src/inspector/worker_inspector.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/inspector/worker_inspector.h b/src/inspector/worker_inspector.h index e3c96cf62f01b0..c1d3b8a5711740 100644 --- a/src/inspector/worker_inspector.h +++ b/src/inspector/worker_inspector.h @@ -21,6 +21,7 @@ class WorkerDelegate { const std::string& url, bool waiting, std::shared_ptr worker) = 0; + virtual ~WorkerDelegate() {} }; class WorkerManagerEventHandle {