bug fixing

This commit is contained in:
Michele Caini 2017-02-13 09:17:43 +01:00
parent 44fffd4ae7
commit f1545eb234
2 changed files with 7 additions and 5 deletions

View File

@ -97,7 +97,7 @@ class Emitter {
}
Connection on(Listener f) {
return onL.emplace(onL.cbegin(), false, std::move(f));
return onL.emplace(onL.cend(), false, std::move(f));
}
void erase(Connection conn) noexcept {
@ -139,7 +139,7 @@ class Emitter {
return counter++;
}
template<typename E>
template<typename>
static std::size_t event_type() noexcept {
static std::size_t value = next_type();
return value;

View File

@ -146,9 +146,11 @@ public:
* > The convention is that stdio[0] points to stdin, fd 1 is used
* > for stdout, and fd 2 is stderr.
*/
std::vector<uv_stdio_container_t> poStdio{poFdStdio.size() + poStreamStdio.size()};
poStdio.insert(poStdio.begin(), poStreamStdio.cbegin(), poStreamStdio.cend());
poStdio.insert(poStdio.begin(), poFdStdio.cbegin(), poFdStdio.cend());
po.stdio_count = poStreamStdio.size() + poFdStdio.size();
uv_stdio_container_t stdio[po.stdio_count];
std::copy(poFdStdio.cbegin(), poFdStdio.cend(), stdio);
std::copy(poStreamStdio.cbegin(), poStreamStdio.cend(), stdio + poFdStdio.size());
po.stdio = stdio;
invoke(&uv_spawn, parent(), get(), &po);
}