projects
/
folly.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
3823727
)
takeOwnershipOfPipes method releases memory
author
Yuri Putivsky
<yuri@fb.com>
Fri, 29 Jul 2016 02:19:25 +0000
(19:19 -0700)
committer
Facebook Github Bot 0
<facebook-github-bot-0-bot@fb.com>
Fri, 29 Jul 2016 02:23:48 +0000
(19:23 -0700)
Summary: takeOwnershipOfPipes should left zero heap memory allocated in folly:Subprocess class instance.
Reviewed By: snarkmaster
Differential Revision:
D3638503
fbshipit-source-id:
aac7b10bd7399c44868f32c01164f4123892598f
folly/Subprocess.cpp
patch
|
blob
|
history
diff --git
a/folly/Subprocess.cpp
b/folly/Subprocess.cpp
index 1e294ba767b985b91d083877f9eab3984cfe324d..d7d28d9f4b150dd58375023bbf78ef85f4341105 100644
(file)
--- a/
folly/Subprocess.cpp
+++ b/
folly/Subprocess.cpp
@@
-832,7
+832,8
@@
std::vector<Subprocess::ChildPipe> Subprocess::takeOwnershipOfPipes() {
for (auto& p : pipes_) {
pipes.emplace_back(p.childFd, std::move(p.pipe));
}
- pipes_.clear();
+ // release memory
+ std::vector<Pipe>().swap(pipes_);
return pipes;
}