src: mark AsyncWrap destructor as virtual
authorBen Noordhuis <info@bnoordhuis.nl>
Thu, 23 Oct 2014 20:04:47 +0000 (22:04 +0200)
committerBen Noordhuis <info@bnoordhuis.nl>
Thu, 23 Oct 2014 20:49:59 +0000 (22:49 +0200)
Make AsyncWrap::~AsyncWrap() virtual, otherwise it is unsafe to delete
a derived class through a pointer to AsyncWrap.  Fortunately, we don't
do that anywhere right now; this commit is merely a preemptive bug fix.

src/async-wrap.h

index a857798..d345547 100644 (file)
@@ -61,7 +61,7 @@ class AsyncWrap : public BaseObject {
                    v8::Handle<v8::Object> object,
                    ProviderType provider);
 
-  inline ~AsyncWrap() = default;
+  inline virtual ~AsyncWrap() = default;
 
   inline bool has_async_listener();