Community

A trick for keeping an object alive in a C++ lambda while still being able to use the this keyword to refer to it

(Raymond Chen) You may want to capture your this pointer into a C++ lambda, but that captures the raw pointer. If you need to extend the object’s lifetime, you will need to capture a strong reference.