Skip to content

Commit 1ae28d1

Browse files
russelltgpaceholder
authored andcommitted
Add virtual constructors to abstract classes -- could create memory
leaks
1 parent 7d43afa commit 1ae28d1

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

src/NodeData.hpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ struct NodeDataType
1616
class NODE_EDITOR_PUBLIC NodeData
1717
{
1818
public:
19+
20+
virtual
21+
~NodeData() = default;
22+
1923
virtual bool sameType(NodeData const &nodeData) const
2024
{
2125
return (this->type().id == nodeData.type().id);

src/Style.hpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,13 @@
44

55
class Style
66
{
7+
public:
78

8-
private:
9+
virtual
10+
~Style() = default;
911

12+
private:
13+
1014
virtual void
1115
loadJsonText(QString jsonText) = 0;
1216

0 commit comments

Comments
 (0)