Merge pull request #10 from cconlon/finalize

remove try/catch block from finalize methods
pull/13/head
toddouska 2016-10-19 12:11:53 -07:00 committed by GitHub
commit 39e3a3579f
2 changed files with 10 additions and 20 deletions

View File

@ -1544,17 +1544,12 @@ public class WolfSSLContext {
@Override @Override
protected void finalize() throws Throwable protected void finalize() throws Throwable
{ {
try {
if (this.active == true) { if (this.active == true) {
/* free resources, set state */ /* free resources, set state */
this.free(); this.free();
this.active = false; this.active = false;
} }
} catch (Throwable t) {
throw t;
} finally {
super.finalize(); super.finalize();
} }
}
} /* end WolfSSLContext */ } /* end WolfSSLContext */

View File

@ -2109,18 +2109,13 @@ public class WolfSSLSession {
@Override @Override
protected void finalize() throws Throwable protected void finalize() throws Throwable
{ {
try {
if (this.active == true) { if (this.active == true) {
/* free resources, set state */ /* free resources, set state */
this.freeSSL(); this.freeSSL();
this.active = false; this.active = false;
} }
} catch (Throwable t) {
throw t;
} finally {
super.finalize(); super.finalize();
} }
}
} /* end WolfSSLSession */ } /* end WolfSSLSession */