提交 10c95b9a 编写于 作者: X xulongteng

Fix memory leak

Change-Id: I5297891f3002f851c3eb0988205f2abf108572f5
上级 f8c466f4
......@@ -28,6 +28,16 @@ struct MempoolRegion {
im::fugue::memory::Region* _region;
im::Mempool* _mempool;
~MempoolRegion() {
if (_region) {
delete _region;
_region = NULL;
}
if (_mempool) {
delete _mempool;
_mempool = NULL;
}
}
};
int MempoolWrapper::initialize() {
......@@ -57,6 +67,7 @@ int MempoolWrapper::thread_initialize() {
LOG(ERROR) << "unable to set the thrd_data";
delete region;
delete mempool;
delete mempool_region;
return -1;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册