--- a/src/PassthroughHandler.h Mon Dec 10 10:47:34 2018 +0100
+++ b/src/PassthroughHandler.h Mon Dec 10 15:19:33 2018 +0100
@@ -44,14 +44,11 @@
// TODO: use rather RelationalReaderValueHadler
class PassthroughHandler : public RelationalReaderStringHadler {
private:
- writer::RelationalWriter* relationalWriter;
+ std::shared_ptr<writer::RelationalWriter> relationalWriter;
public:
- PassthroughHandler(std::ostream& output) : relationalWriter(writer::Factory::create(output)) {
- }
-
- virtual ~PassthroughHandler() {
- delete relationalWriter;
+ PassthroughHandler(std::ostream& output) {
+ relationalWriter.reset(writer::Factory::create(output));
}
void startRelation(string_t name, std::vector<AttributeMetadata> attributes) override {