Skip to content

Commit 8a00961

Browse files
committed
src: mark more destructors with override keyword
The previous commits fixed oversights in destructors that should have been marked virtual but weren't. This commit marks destructors from derived classes with the override keyword.
1 parent d2131b7 commit 8a00961

File tree

9 files changed

+17
-17
lines changed

9 files changed

+17
-17
lines changed

src/async-wrap.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ class AsyncWrap : public BaseObject {
6161
v8::Handle<v8::Object> object,
6262
ProviderType provider);
6363

64-
inline virtual ~AsyncWrap() = default;
64+
inline virtual ~AsyncWrap() override = default;
6565

6666
inline bool has_async_listener();
6767

src/node_contextify.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -698,7 +698,7 @@ class ContextifyScript : public BaseObject {
698698
}
699699

700700

701-
~ContextifyScript() {
701+
~ContextifyScript() override {
702702
script_.Reset();
703703
}
704704
};

src/node_crypto.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4254,7 +4254,7 @@ class PBKDF2Request : public AsyncWrap {
42544254
FatalError("node::PBKDF2Request()", "Out of Memory");
42554255
}
42564256

4257-
~PBKDF2Request() {
4257+
~PBKDF2Request() override {
42584258
persistent().Reset();
42594259
}
42604260

@@ -4504,7 +4504,7 @@ class RandomBytesRequest : public AsyncWrap {
45044504
FatalError("node::RandomBytesRequest()", "Out of Memory");
45054505
}
45064506

4507-
~RandomBytesRequest() {
4507+
~RandomBytesRequest() override {
45084508
persistent().Reset();
45094509
}
45104510

src/node_crypto.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ class Connection;
7171

7272
class SecureContext : public BaseObject {
7373
public:
74-
~SecureContext() {
74+
~SecureContext() override {
7575
FreeCTXMem();
7676
}
7777

@@ -271,7 +271,7 @@ class SSLWrap {
271271
// assumes that any args.This() called will be the handle from Connection.
272272
class Connection : public SSLWrap<Connection>, public AsyncWrap {
273273
public:
274-
~Connection() {
274+
~Connection() override {
275275
#ifdef SSL_CTRL_SET_TLSEXT_SERVERNAME_CB
276276
sniObject_.Reset();
277277
sniContext_.Reset();
@@ -361,7 +361,7 @@ class Connection : public SSLWrap<Connection>, public AsyncWrap {
361361

362362
class CipherBase : public BaseObject {
363363
public:
364-
~CipherBase() {
364+
~CipherBase() override {
365365
if (!initialised_)
366366
return;
367367
delete[] auth_tag_;
@@ -425,7 +425,7 @@ class CipherBase : public BaseObject {
425425

426426
class Hmac : public BaseObject {
427427
public:
428-
~Hmac() {
428+
~Hmac() override {
429429
if (!initialised_)
430430
return;
431431
HMAC_CTX_cleanup(&ctx_);
@@ -458,7 +458,7 @@ class Hmac : public BaseObject {
458458

459459
class Hash : public BaseObject {
460460
public:
461-
~Hash() {
461+
~Hash() override {
462462
if (!initialised_)
463463
return;
464464
EVP_MD_CTX_cleanup(&mdctx_);
@@ -505,7 +505,7 @@ class SignBase : public BaseObject {
505505
initialised_(false) {
506506
}
507507

508-
~SignBase() {
508+
~SignBase() override {
509509
if (!initialised_)
510510
return;
511511
EVP_MD_CTX_cleanup(&mdctx_);
@@ -598,7 +598,7 @@ class PublicKeyCipher {
598598

599599
class DiffieHellman : public BaseObject {
600600
public:
601-
~DiffieHellman() {
601+
~DiffieHellman() override {
602602
if (dh != nullptr) {
603603
DH_free(dh);
604604
}
@@ -644,7 +644,7 @@ class DiffieHellman : public BaseObject {
644644

645645
class ECDH : public BaseObject {
646646
public:
647-
~ECDH() {
647+
~ECDH() override {
648648
if (key_ != nullptr)
649649
EC_KEY_free(key_);
650650
key_ = nullptr;

src/node_http_parser.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ class Parser : public BaseObject {
174174
}
175175

176176

177-
~Parser() {
177+
~Parser() override {
178178
ClearWrap(object());
179179
persistent().Reset();
180180
}

src/node_zlib.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ class ZCtx : public AsyncWrap {
9393
}
9494

9595

96-
~ZCtx() {
96+
~ZCtx() override {
9797
CHECK_EQ(false, write_in_progress_ && "write in progress");
9898
Close();
9999
}

src/req_wrap.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ class ReqWrap : public AsyncWrap {
4545
}
4646

4747

48-
~ReqWrap() {
48+
~ReqWrap() override {
4949
QUEUE_REMOVE(&req_wrap_queue_);
5050
// Assert that someone has called Dispatched()
5151
CHECK_EQ(req_.data, this);

src/string_bytes.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ using v8::Value;
4747
template <typename ResourceType, typename TypeName>
4848
class ExternString: public ResourceType {
4949
public:
50-
~ExternString() {
50+
~ExternString() override {
5151
delete[] data_;
5252
int64_t change_in_bytes = -static_cast<int64_t>(length_);
5353
isolate()->AdjustAmountOfExternalAllocatedMemory(change_in_bytes);

src/tls_wrap.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ class TLSCallbacks : public crypto::SSLWrap<TLSCallbacks>,
4646
public StreamWrapCallbacks,
4747
public AsyncWrap {
4848
public:
49-
~TLSCallbacks();
49+
~TLSCallbacks() override;
5050

5151
static void Initialize(v8::Handle<v8::Object> target,
5252
v8::Handle<v8::Value> unused,

0 commit comments

Comments
 (0)