[
https://issues.apache.org/jira/browse/MESOS-6038?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15424946#comment-15424946
]
ASF GitHub Bot commented on MESOS-6038:
---------------------------------------
Github user aaronjwood commented on the issue:
https://github.com/apache/mesos/pull/157
I might be misunderstanding things but why can we not do this? I see it
being done here
https://github.com/apache/mesos/blob/master/3rdparty/libprocess/src/http.cpp#L1001
If we make the `Promise` local like it is in this patch, pass its address
into the tuple via the copy constructor (that should be the copy constructor
getting called, right?) so that it takes a copy and doesn't rely on an actual
address from the stack, and return the future in the same way as the example
above, would that not work? Even though the `Promise` is local to the stack,
when we return `Future` shouldn't it be a copy of what's needed underneath?
> Prevent leaking allocated memory for Promises
> ---------------------------------------------
>
> Key: MESOS-6038
> URL: https://issues.apache.org/jira/browse/MESOS-6038
> Project: Mesos
> Issue Type: Bug
> Components: c++ api, libprocess
> Reporter: Aaron Wood
> Priority: Minor
> Labels: github-import, patch
>
> I had found a few places where these Promise objects were leaking. Once the
> Future was returned there was no way to free the memory for the Promise
> object that had been allocated thus causing the leak.
> https://reviews.apache.org/r/51068/
> https://github.com/apache/mesos/pull/157
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)