未验证 提交 2856c2b7 编写于 作者: J Jiaying Zhao 提交者: GitHub

[Mobile][ARM]fix possible memory leak of tensor in CPUContext.test=mobile (#2695)

上级 4300ef75
...@@ -44,15 +44,13 @@ namespace framework { ...@@ -44,15 +44,13 @@ namespace framework {
struct CPUContext { struct CPUContext {
private: private:
CPUContext(); CPUContext();
virtual ~CPUContext() {}
public: public:
~CPUContext() {}
static CPUContext* Context() { static CPUContext* Context() {
static CPUContext* ctx = nullptr; static CPUContext ctx;
if (ctx == nullptr) { return &ctx;
ctx = new CPUContext();
}
return ctx;
} }
void set_thread_num(int thread_num, void set_thread_num(int thread_num,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册