Jie Yu created MESOS-877:
----------------------------

             Summary: 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
             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)

Reply via email to