mirror of
https://github.com/robbert-vdh/yabridge.git
synced 2026-05-09 20:29:10 +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
|
||||||
|
|
||||||
|
- 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.
|
- Made the plugin and host detection slightly more robust.
|
||||||
|
|
||||||
## [1.1.4] - 2020-05-12
|
## [1.1.4] - 2020-05-12
|
||||||
|
|||||||
@@ -612,16 +612,19 @@ void PluginBridge::async_log_pipe_lines(patched_async_pipe& pipe,
|
|||||||
boost::asio::streambuf& buffer,
|
boost::asio::streambuf& buffer,
|
||||||
std::string prefix) {
|
std::string prefix) {
|
||||||
boost::asio::async_read_until(
|
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::string line;
|
||||||
std::getline(std::istream(&buffer), line);
|
std::getline(std::istream(&buffer), line);
|
||||||
logger.log(prefix + line);
|
logger.log(prefix + line);
|
||||||
|
|
||||||
// Not sure why, but this async read will keep reading a ton of
|
async_log_pipe_lines(pipe, buffer, prefix);
|
||||||
// empty lines after the Wine process crashes
|
|
||||||
if (vst_host.running()) {
|
|
||||||
async_log_pipe_lines(pipe, buffer, prefix);
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user