diff -r 1a0fbd17db13 -r 62ced7c41c67 src/relpipe-out-mqtt.cpp --- a/src/relpipe-out-mqtt.cpp Sun May 08 21:42:25 2022 +0200 +++ b/src/relpipe-out-mqtt.cpp Sun Jun 05 00:08:52 2022 +0200 @@ -44,8 +44,8 @@ CLIParser cliParser; Configuration configuration = cliParser.parse(cli.arguments()); std::shared_ptr reader(Factory::create(std::cin)); - MQTTHandler handler(configuration); - reader->addHandler(&handler); + std::shared_ptr handler(MQTTHandler::create(configuration)); + reader->addHandler(handler.get()); reader->process(); resultCode = CLI::EXIT_CODE_SUCCESS; } catch (RelpipeCLIException e) {