From ead94bfc6c6f30d0cb31f321193d6b15bb9b2b38 Mon Sep 17 00:00:00 2001 From: Xin Pan Date: Tue, 6 Nov 2018 10:26:02 +0800 Subject: [PATCH] fix destructor test=develop --- paddle/fluid/framework/ir/node.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/paddle/fluid/framework/ir/node.h b/paddle/fluid/framework/ir/node.h index e41e032d142..1b7364858dc 100644 --- a/paddle/fluid/framework/ir/node.h +++ b/paddle/fluid/framework/ir/node.h @@ -27,7 +27,11 @@ namespace ir { // Node should normally created by Graph::CreateXXXNode(). class Node { public: - virtual ~Node() {} + virtual ~Node() { + if (!wrapper_.empty()) { + wrapper_deleter_(); + } + } enum class Type { kOperation, kVariable }; static constexpr char kControlDepVarName[] = "__control_var"; -- GitLab