On 06/04/2015 07:29 AM, Andrew Osmond wrote:
> Suppose I have some ref counted class Foo with the private member mBar.
> Normally with a lambda expression, [...]
> obviously the Foo object could get released before the dispatch
> completes

You may be interested in this thread from a few months back:
"Proposal to ban the usage of refcounted objects inside C++ lambdas in
Gecko"
https://groups.google.com/d/msg/mozilla.dev.platform/Ec2y6BWKrbM/xpHLGwJ337wJ

(Not sure it arrived at a concrete conclusion, but you may run across
some pitfalls/suggestions at least. I haven't used lambdas in C++, so I
won't attempt to directly answer your question.)

~Daniel
_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform

Reply via email to