From 624fbf6f227575fb9296f44856e5ff98fb7c03f9 Mon Sep 17 00:00:00 2001 From: Cloud Wu Date: Fri, 2 Jun 2017 19:16:36 +0800 Subject: [PATCH] fix issue #648 --- service/debug_console.lua | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/service/debug_console.lua b/service/debug_console.lua index 830a81c0..07bae9fb 100644 --- a/service/debug_console.lua +++ b/service/debug_console.lua @@ -281,12 +281,17 @@ function COMMANDX.debug(cmd) end skynet.fork(function() pcall(forward_cmd) - skynet.wakeup(term_co) + if not stop then -- block at skynet.call "start" + term_co = nil + skynet.wakeup(term_co) + end end) local ok, err = skynet.call(agent, "lua", "start", address, cmd.fd) stop = true - -- wait for fork coroutine exit. - skynet.wait(term_co) + if term_co then + -- wait for fork coroutine exit. + skynet.wait(term_co) + end if not ok then error(err)