From 746554c3560e8fefd1d16a70b3ad568db6c4d928 Mon Sep 17 00:00:00 2001
From: tobiglaser <76131623+tobiglaser@users.noreply.github.com>
Date: Mon, 11 Apr 2022 23:25:00 +0200
Subject: [PATCH] constructor according to sheet + destructor debug

---
 src/Element.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/Element.h b/src/Element.h
index fc225ba..a87b644 100644
--- a/src/Element.h
+++ b/src/Element.h
@@ -11,7 +11,8 @@ private:
     std::shared_ptr<Command> cmd;
 
 public:
-    Element(std::shared_ptr<Command> _cmd) { cmd = _cmd; }
+    Element(Command _cmd) { cmd = std::make_shared<Command>(_cmd); }
+    ~Element() { std::cout << "~Element - " << cmd->getName() << '\n'; }
     std::shared_ptr<Command> getCommand() { return cmd; }
     
     void setNext(std::shared_ptr<Element> _next) { next = _next; }
-- 
GitLab