Skip to content

Commit

Permalink
inspector: add virtual destructor to WorkerDelegate
Browse files Browse the repository at this point in the history
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 <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>
  • Loading branch information
danbev authored and jasnell committed Oct 17, 2018
1 parent 5f93676 commit d743f2e
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/inspector/worker_inspector.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ class WorkerDelegate {
const std::string& url,
bool waiting,
std::shared_ptr<MainThreadHandle> worker) = 0;
virtual ~WorkerDelegate() {}
};

class WorkerManagerEventHandle {
Expand Down

0 comments on commit d743f2e

Please sign in to comment.