Skip to content

Commit

Permalink
jvmSandbox对象在一定情况下可能为空,导致这种情况的可能是destroy()调用发生在bind()方法调用之前
Browse files Browse the repository at this point in the history
所以这里做了一个判空处理,临时性解决这个问题。真正需要深究的是为什么destroy()竟然能在bind()之前被调用
  • Loading branch information
dongchenxu committed Dec 11, 2019
1 parent 6fe5e48 commit be731d7
Showing 1 changed file with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public void process() throws Throwable {

// destroy http server
logger.info("{} is destroying", this);
while (!httpServer.isStopped());
while (!httpServer.isStopped()) ;
httpServer.destroy();

} catch (Throwable cause) {
Expand Down Expand Up @@ -221,7 +221,14 @@ public void process() throws Throwable {
public void destroy() {

// 关闭JVM-SANDBOX
jvmSandbox.destroy();
/*
* BUGFIX:
* jvmSandbox对象在一定情况下可能为空,导致这种情况的可能是destroy()调用发生在bind()方法调用之前
* 所以这里做了一个判空处理,临时性解决这个问题。真正需要深究的是为什么destroy()竟然能在bind()之前被调用
*/
if (null != jvmSandbox) {
jvmSandbox.destroy();
}

// 关闭HTTP服务器
if (isBind()) {
Expand Down

0 comments on commit be731d7

Please sign in to comment.