emit exit after close
Merge pull request #564 from luvit/fixes/emit_exit_on_nexttick

emit exit after close