Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
0.21.0, 0.21.1
-
None
-
None
-
Twitter Mesos Q1 Sprint 1
-
2
Description
For example, when a future has transitioned into READY state, all onDiscard callbacks should be cleared to avoid potential cyclic dependency and memory leak. For instance:
Promise<Nothing> promise; Future<Nothing> f = promise.future(); f.onDiscard(lambda::bind(&SomeFunc, f)); promise.set(Nothing());
The above code has a cyclic dependency because f.data has a reference to the future inside an std::function which has a reference to f.data.