mirror of
https://github.com/robbert-vdh/yabridge.git
synced 2026-05-07 03:50:11 +02:00
Fix empty line spam in log file when Wine crashes
This commit is contained in:
@@ -14,6 +14,8 @@ Versioning](https://semver.org/spec/v2.0.0.html).
|
||||
|
||||
### Fixed
|
||||
|
||||
- Fixed large amount of empty lines in the log file when the Wine process closes
|
||||
unexpectedly.
|
||||
- Made the plugin and host detection slightly more robust.
|
||||
|
||||
## [1.1.4] - 2020-05-12
|
||||
|
||||
@@ -612,16 +612,19 @@ void PluginBridge::async_log_pipe_lines(patched_async_pipe& pipe,
|
||||
boost::asio::streambuf& buffer,
|
||||
std::string prefix) {
|
||||
boost::asio::async_read_until(
|
||||
pipe, buffer, '\n', [&, prefix](const auto&, size_t) {
|
||||
pipe, buffer, '\n',
|
||||
[&, prefix](const boost::system::error_code& error, size_t) {
|
||||
// When we get an error code then that likely means that the pipe
|
||||
// has been clsoed and we have reached the end of the file
|
||||
if (error.failed()) {
|
||||
return;
|
||||
}
|
||||
|
||||
std::string line;
|
||||
std::getline(std::istream(&buffer), line);
|
||||
logger.log(prefix + line);
|
||||
|
||||
// Not sure why, but this async read will keep reading a ton of
|
||||
// empty lines after the Wine process crashes
|
||||
if (vst_host.running()) {
|
||||
async_log_pipe_lines(pipe, buffer, prefix);
|
||||
}
|
||||
async_log_pipe_lines(pipe, buffer, prefix);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user