Implement SecureContext destructor

This commit is contained in:
Ryan Dahl 2010-11-30 16:28:50 -08:00
parent ea540c94f8
commit 355936dcde
2 changed files with 10 additions and 1 deletions

View File

@ -263,6 +263,7 @@ Handle<Value> SecureContext::Close(const Arguments& args) {
if (sc->ctx_ != NULL) {
SSL_CTX_free(sc->ctx_);
sc->ctx_ = NULL;
return True();
}

View File

@ -40,7 +40,15 @@ class SecureContext : ObjectWrap {
}
~SecureContext() {
// Free up
if (ctx_) {
SSL_CTX_free(ctx_);
ctx_ = NULL;
}
if (ca_store_) {
X509_STORE_free(ca_store_);
ca_store_ = NULL;
}
}
private: