Fix logerror

This commit is contained in:
Vas Crabb 2016-03-19 13:09:12 +11:00
parent 042fe7a2ab
commit ba1d81dd19
2 changed files with 2 additions and 1 deletions

View File

@ -761,6 +761,7 @@ void running_machine::add_notifier(machine_notification event, machine_notify_de
void running_machine::add_logerror_callback(logerror_callback callback)
{
assert_always(m_current_phase == MACHINE_PHASE_INIT, "Can only call add_logerror_callback at init time!");
m_string_buffer.reserve(1024);
m_logerror_list.push_back(std::make_unique<logerror_callback_item>(callback));
}
@ -1011,7 +1012,6 @@ void running_machine::logfile_callback(const running_machine &machine, const cha
if (machine.m_logfile != nullptr)
{
machine.m_logfile->puts(buffer);
machine.m_logfile->flush();
}
}

View File

@ -61,6 +61,7 @@ inline void running_machine::logerror(Format &&fmt, Params &&... args) const
// dump to the buffer
m_string_buffer.clear();
m_string_buffer.seekp(0);
util::stream_format(m_string_buffer, std::forward<Format>(fmt), std::forward<Params>(args)...);
m_string_buffer.put('\0');