Browse Source

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.
archived-io.js-v0.12
Ben Noordhuis 10 years ago
parent
commit
8a00961b81
  1. 2
      src/async-wrap.h
  2. 2
      src/node_contextify.cc
  3. 4
      src/node_crypto.cc
  4. 16
      src/node_crypto.h
  5. 2
      src/node_http_parser.cc
  6. 2
      src/node_zlib.cc
  7. 2
      src/req_wrap.h
  8. 2
      src/string_bytes.cc
  9. 2
      src/tls_wrap.h

2
src/async-wrap.h

@ -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();

2
src/node_contextify.cc

@ -698,7 +698,7 @@ class ContextifyScript : public BaseObject {
}
~ContextifyScript() {
~ContextifyScript() override {
script_.Reset();
}
};

4
src/node_crypto.cc

@ -4254,7 +4254,7 @@ class PBKDF2Request : public AsyncWrap {
FatalError("node::PBKDF2Request()", "Out of Memory");
}
~PBKDF2Request() {
~PBKDF2Request() override {
persistent().Reset();
}
@ -4504,7 +4504,7 @@ class RandomBytesRequest : public AsyncWrap {
FatalError("node::RandomBytesRequest()", "Out of Memory");
}
~RandomBytesRequest() {
~RandomBytesRequest() override {
persistent().Reset();
}

16
src/node_crypto.h

@ -71,7 +71,7 @@ class Connection;
class SecureContext : public BaseObject {
public:
~SecureContext() {
~SecureContext() override {
FreeCTXMem();
}
@ -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();
@ -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_;
@ -425,7 +425,7 @@ class CipherBase : public BaseObject {
class Hmac : public BaseObject {
public:
~Hmac() {
~Hmac() override {
if (!initialised_)
return;
HMAC_CTX_cleanup(&ctx_);
@ -458,7 +458,7 @@ class Hmac : public BaseObject {
class Hash : public BaseObject {
public:
~Hash() {
~Hash() override {
if (!initialised_)
return;
EVP_MD_CTX_cleanup(&mdctx_);
@ -505,7 +505,7 @@ class SignBase : public BaseObject {
initialised_(false) {
}
~SignBase() {
~SignBase() override {
if (!initialised_)
return;
EVP_MD_CTX_cleanup(&mdctx_);
@ -598,7 +598,7 @@ class PublicKeyCipher {
class DiffieHellman : public BaseObject {
public:
~DiffieHellman() {
~DiffieHellman() override {
if (dh != nullptr) {
DH_free(dh);
}
@ -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;

2
src/node_http_parser.cc

@ -174,7 +174,7 @@ class Parser : public BaseObject {
}
~Parser() {
~Parser() override {
ClearWrap(object());
persistent().Reset();
}

2
src/node_zlib.cc

@ -93,7 +93,7 @@ class ZCtx : public AsyncWrap {
}
~ZCtx() {
~ZCtx() override {
CHECK_EQ(false, write_in_progress_ && "write in progress");
Close();
}

2
src/req_wrap.h

@ -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);

2
src/string_bytes.cc

@ -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);

2
src/tls_wrap.h

@ -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,

Loading…
Cancel
Save