You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mesos.apache.org by "Jie Yu (JIRA)" <ji...@apache.org> on 2013/12/12 01:46:07 UTC
[jira] [Commented] (MESOS-877) Future::then and Promise::associate
have memory leaks.
[ https://issues.apache.org/jira/browse/MESOS-877?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13845928#comment-13845928 ]
Jie Yu commented on MESOS-877:
------------------------------
https://reviews.apache.org/r/16197/
> Future::then and Promise::associate have memory leaks.
> ------------------------------------------------------
>
> Key: MESOS-877
> URL: https://issues.apache.org/jira/browse/MESOS-877
> Project: Mesos
> Issue Type: Bug
> Affects Versions: 0.16.0
> Reporter: Jie Yu
> Assignee: Jie Yu
> Fix For: 0.17.0
>
>
> As commented in Future::then, there is a memory leak (cyclic dependency). Recently, the change in Promise::associate (https://issues.apache.org/jira/browse/MESOS-807) makes it worse.
> // TODO(benh): Need to pass 'future' as a weak_ptr so that we can
> // avoid reference counting cycles!
> std::tr1::function<void(void)> discard =
> std::tr1::bind(&Future<T>::discard, *this);
> promise->future().onDiscarded(discard);
--
This message was sent by Atlassian JIRA
(v6.1.4#6159)