Fixed assert when try read unavailable stdin.
This commit is contained in:
parent
1720d3e096
commit
62681adcfb
1 changed files with 5 additions and 1 deletions
|
@ -31,8 +31,12 @@ Console::Console(IConsoleListener *listener)
|
||||||
{
|
{
|
||||||
m_tty.data = this;
|
m_tty.data = this;
|
||||||
uv_tty_init(uv_default_loop(), &m_tty, 0, 1);
|
uv_tty_init(uv_default_loop(), &m_tty, 0, 1);
|
||||||
uv_tty_set_mode(&m_tty, UV_TTY_MODE_RAW);
|
|
||||||
|
|
||||||
|
if (!uv_is_readable(reinterpret_cast<uv_stream_t*>(&m_tty))) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
uv_tty_set_mode(&m_tty, UV_TTY_MODE_RAW);
|
||||||
uv_read_start(reinterpret_cast<uv_stream_t*>(&m_tty), Console::onAllocBuffer, Console::onRead);
|
uv_read_start(reinterpret_cast<uv_stream_t*>(&m_tty), Console::onAllocBuffer, Console::onRead);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue