提交 0db5470a 编写于 作者: Z zhangyang0701

fix memory leakage problem

上级 cc242c7b
...@@ -32,7 +32,16 @@ class Scope { ...@@ -32,7 +32,16 @@ class Scope {
Scope() = default; Scope() = default;
~Scope() { ~Scope() {
DropKids(); for (auto &var : vars_) {
DropKids();
delete var.second;
}
vars_.clear();
for (auto kid : kids_) {
delete kid;
}
kids_.clear();
#ifdef PADDLE_MOBILE_CL #ifdef PADDLE_MOBILE_CL
delete cl_scope_; delete cl_scope_;
#endif #endif
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册