Skip to content

Commit

Permalink
src: mark more destructors with override keyword
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
bnoordhuis committed Oct 23, 2014
1 parent d2131b7 commit 8a00961
Show file tree
Hide file tree
Showing 9 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion src/async-wrap.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class AsyncWrap : public BaseObject {
v8::Handle<v8::Object> object,
ProviderType provider);

inline virtual ~AsyncWrap() = default;
inline virtual ~AsyncWrap() override = default;

inline bool has_async_listener();

Expand Down
2 changes: 1 addition & 1 deletion src/node_contextify.cc
Original file line number Diff line number Diff line change
Expand Up @@ -698,7 +698,7 @@ class ContextifyScript : public BaseObject {
}


~ContextifyScript() {
~ContextifyScript() override {
script_.Reset();
}
};
Expand Down
4 changes: 2 additions & 2 deletions src/node_crypto.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4254,7 +4254,7 @@ class PBKDF2Request : public AsyncWrap {
FatalError("node::PBKDF2Request()", "Out of Memory");
}

~PBKDF2Request() {
~PBKDF2Request() override {
persistent().Reset();
}

Expand Down Expand Up @@ -4504,7 +4504,7 @@ class RandomBytesRequest : public AsyncWrap {
FatalError("node::RandomBytesRequest()", "Out of Memory");
}

~RandomBytesRequest() {
~RandomBytesRequest() override {
persistent().Reset();
}

Expand Down
16 changes: 8 additions & 8 deletions src/node_crypto.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ class Connection;

class SecureContext : public BaseObject {
public:
~SecureContext() {
~SecureContext() override {
FreeCTXMem();
}

Expand Down Expand Up @@ -271,7 +271,7 @@ class SSLWrap {
// assumes that any args.This() called will be the handle from Connection.
class Connection : public SSLWrap<Connection>, public AsyncWrap {
public:
~Connection() {
~Connection() override {
#ifdef SSL_CTRL_SET_TLSEXT_SERVERNAME_CB
sniObject_.Reset();
sniContext_.Reset();
Expand Down Expand Up @@ -361,7 +361,7 @@ class Connection : public SSLWrap<Connection>, public AsyncWrap {

class CipherBase : public BaseObject {
public:
~CipherBase() {
~CipherBase() override {
if (!initialised_)
return;
delete[] auth_tag_;
Expand Down Expand Up @@ -425,7 +425,7 @@ class CipherBase : public BaseObject {

class Hmac : public BaseObject {
public:
~Hmac() {
~Hmac() override {
if (!initialised_)
return;
HMAC_CTX_cleanup(&ctx_);
Expand Down Expand Up @@ -458,7 +458,7 @@ class Hmac : public BaseObject {

class Hash : public BaseObject {
public:
~Hash() {
~Hash() override {
if (!initialised_)
return;
EVP_MD_CTX_cleanup(&mdctx_);
Expand Down Expand Up @@ -505,7 +505,7 @@ class SignBase : public BaseObject {
initialised_(false) {
}

~SignBase() {
~SignBase() override {
if (!initialised_)
return;
EVP_MD_CTX_cleanup(&mdctx_);
Expand Down Expand Up @@ -598,7 +598,7 @@ class PublicKeyCipher {

class DiffieHellman : public BaseObject {
public:
~DiffieHellman() {
~DiffieHellman() override {
if (dh != nullptr) {
DH_free(dh);
}
Expand Down Expand Up @@ -644,7 +644,7 @@ class DiffieHellman : public BaseObject {

class ECDH : public BaseObject {
public:
~ECDH() {
~ECDH() override {
if (key_ != nullptr)
EC_KEY_free(key_);
key_ = nullptr;
Expand Down
2 changes: 1 addition & 1 deletion src/node_http_parser.cc
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ class Parser : public BaseObject {
}


~Parser() {
~Parser() override {
ClearWrap(object());
persistent().Reset();
}
Expand Down
2 changes: 1 addition & 1 deletion src/node_zlib.cc
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ class ZCtx : public AsyncWrap {
}


~ZCtx() {
~ZCtx() override {
CHECK_EQ(false, write_in_progress_ && "write in progress");
Close();
}
Expand Down
2 changes: 1 addition & 1 deletion src/req_wrap.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class ReqWrap : public AsyncWrap {
}


~ReqWrap() {
~ReqWrap() override {
QUEUE_REMOVE(&req_wrap_queue_);
// Assert that someone has called Dispatched()
CHECK_EQ(req_.data, this);
Expand Down
2 changes: 1 addition & 1 deletion src/string_bytes.cc
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ using v8::Value;
template <typename ResourceType, typename TypeName>
class ExternString: public ResourceType {
public:
~ExternString() {
~ExternString() override {
delete[] data_;
int64_t change_in_bytes = -static_cast<int64_t>(length_);
isolate()->AdjustAmountOfExternalAllocatedMemory(change_in_bytes);
Expand Down
2 changes: 1 addition & 1 deletion src/tls_wrap.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class TLSCallbacks : public crypto::SSLWrap<TLSCallbacks>,
public StreamWrapCallbacks,
public AsyncWrap {
public:
~TLSCallbacks();
~TLSCallbacks() override;

static void Initialize(v8::Handle<v8::Object> target,
v8::Handle<v8::Value> unused,
Expand Down

0 comments on commit 8a00961

Please sign in to comment.