Avoid potential UB in loggers using composition

This cast would work fine, but any other fields added to those loggers
would be left uninitialized.
This commit is contained in:
Robbert van der Helm
2020-12-04 18:52:33 +01:00
parent c1e7f53cd0
commit 426231a22b
9 changed files with 76 additions and 22 deletions
+1 -3
View File
@@ -27,9 +27,7 @@ Vst3PluginBridge::Vst3PluginBridge()
.string()),
true);
}),
// TODO: This is UB, use composition with `generic_logger` instead
logger(static_cast<Vst3Logger&&>(Logger::create_from_environment(
create_logger_prefix(sockets.base_dir)))) {
logger(generic_logger) {
log_init_message();
// This will block until all sockets have been connected to by the Wine VST