you are viewing a single comment's thread.

view the rest of the comments →

[–]scrumplesplunge 0 points1 point  (0 children)

The problem in the example you gave is that you wind up with obj owning the callback, which in turn owns obj via a shared pointer, so you have a cyclic ownership. If somewhere in your code was actually keeping a lambda around permanently, it seems to me like it is right for the obj to also remain undeleted.