Fixed bugs in CCClient, added missing delete/desttructors for restart

This commit is contained in:
BenDroid 2017-10-17 22:31:22 +02:00
parent 5c065a8e48
commit 2b97e2f4ff
17 changed files with 194 additions and 110 deletions

View file

@ -40,6 +40,11 @@ Console::Console(IConsoleListener *listener)
uv_read_start(reinterpret_cast<uv_stream_t*>(&m_tty), Console::onAllocBuffer, Console::onRead);
}
Console::~Console()
{
uv_read_stop(reinterpret_cast<uv_stream_t*>(&m_tty));
uv_tty_reset_mode();
}
void Console::onAllocBuffer(uv_handle_t *handle, size_t suggested_size, uv_buf_t *buf)
{
@ -48,7 +53,6 @@ void Console::onAllocBuffer(uv_handle_t *handle, size_t suggested_size, uv_buf_t
buf->base = console->m_buf;
}
void Console::onRead(uv_stream_t *stream, ssize_t nread, const uv_buf_t *buf)
{
if (nread < 0) {