Merge pull request #35 from cconlon/leak2

add finalize() methods for WolfSSLCertManager, WolfSSLCertificate
pull/36/head
JacobBarthelmeh 2020-03-09 15:26:28 -06:00 committed by GitHub
commit d38ee6b440
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 24 additions and 0 deletions

View File

@ -87,4 +87,16 @@ public class WolfSSLCertManager {
/* free Java resources */
this.active = false;
}
@SuppressWarnings("deprecation")
@Override
protected void finalize() throws Throwable
{
if (this.active == true) {
/* free resources, set state */
this.free();
this.active = false;
}
super.finalize();
}
}

View File

@ -391,4 +391,16 @@ public class WolfSSLCertificate {
/* free Java resources */
this.active = false;
}
@SuppressWarnings("deprecation")
@Override
protected void finalize() throws Throwable
{
if (this.active == true) {
/* free resources, set state */
this.free();
this.active = false;
}
super.finalize();
}
}