diff --git a/app/node/node.cpp b/app/node/node.cpp index 6ef47e2d8..7cdfbceb2 100644 --- a/app/node/node.cpp +++ b/app/node/node.cpp @@ -28,6 +28,15 @@ Node::Node() : { } +Node::~Node() +{ + // We delete in the Node destructor rather than relying on the QObject system because the parameter may need to + // perform actions on this Node object and we want them to be done before the Node object is fully destroyed + foreach (NodeParam* param, params_) { + delete param; + } +} + QString Node::Category() { // Return an empty category for any nodes that don't use one @@ -234,6 +243,11 @@ bool Node::IsBlock() return false; } +bool Node::IsTrack() +{ + return false; +} + rational Node::LastProcessedTime() { rational t; diff --git a/app/node/node.h b/app/node/node.h index d3deeeb8c..a02255ad4 100644 --- a/app/node/node.h +++ b/app/node/node.h @@ -51,6 +51,8 @@ class Node : public QObject public: Node(); + virtual ~Node() override; + /** * @brief Creates a clone of the Node * @@ -240,6 +242,14 @@ public: */ virtual bool IsBlock(); + /** + * @brief Returns whether this Node is a "Track" type or not + * + * You shouldn't ever need to override this since all derivatives of Track will automatically have this set to true. + * It's just a more convenient way of checking than dynamic_casting. + */ + virtual bool IsTrack(); + /** * @brief The main processing function *