Turns out my original problem was some other mistake I made. Using just
self works (thanks botond for the poke on IRC about that).

I remember reading the linked thread, although I had since forgotten about
it -- thanks for the reminder. My impression was that using raw pointers
for ref counted objects with lambdas is something to be discouraged,
rightfully so. That's why I use nsRefPtr, just like I would if I explicitly
used a nested class inheriting from nsRunnable instead of a lambda. I'll
review the thread again though (I *did* forgot about using Move, perhaps
other bits as well).

On Thu, Jun 4, 2015 at 2:24 PM, Seth Fowler <s...@mozilla.com> wrote:

>
> > On Jun 4, 2015, at 11:17 AM, Daniel Holbert <dholb...@mozilla.com>
> wrote:
> >
> > 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.)
>
> My impression was that the conclusion was “refcounted objects are not
> banned inside C++ lambdas” - i.e., no policy change from the status quo -
> "but we need to be aware of the pitfalls”. The pitfalls are discussed
> pretty thoroughly in the thread.
>
> - Seth
_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform

Reply via email to