Skip to content

Commit

Permalink
feat(dev): add destructor of taitank safe node
Browse files Browse the repository at this point in the history
  • Loading branch information
meloalright committed Nov 9, 2024
1 parent 95f4ef3 commit a8fe19c
Show file tree
Hide file tree
Showing 7 changed files with 48 additions and 3 deletions.
8 changes: 8 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/git_toolbox_blame.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 11 additions & 0 deletions .idea/taitank-safe.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions include/taitank_safe.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
class TaitankSafeNode {
public:
TaitankSafeNode();
~TaitankSafeNode();
void set_width(double width) const;
void set_height(double height) const;
void do_layout(double parent_width, double parent_height) const;
Expand Down
8 changes: 5 additions & 3 deletions src/taitank_safe.cc
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
#include <iostream>
#include "taitank-safe/include/taitank_safe.h"
#include <functional>
#include <string>

#include "taitank-safe/include/taitank/src/taitank_util.h"
#include "taitank-safe/include/taitank/src/taitank_node.h"
#include "taitank-safe/include/taitank/src/taitank.h"
Expand All @@ -11,6 +9,10 @@ TaitankSafeNode::TaitankSafeNode() {
ptr = new taitank::TaitankNode();
}

TaitankSafeNode::~TaitankSafeNode() {
taitank::NodeFreeRecursive(ptr);
}

std::unique_ptr<TaitankSafeNode> node_create() {
return std::unique_ptr<TaitankSafeNode>(new TaitankSafeNode());
}
Expand Down

0 comments on commit a8fe19c

Please sign in to comment.