Document/solve pitfall when using PromiseSitter together with capturing lambdas
When capturing objects in lambdas, it needs to be ensured that the objects still exist when the lambda is executed.
This also holds true when using the PromiseSitter
and should be explicitly noted since it is easy to "forget" about the promises put into the sitter.
A help to this problem might be to allow passing a context QObject
to PromiseSitter::add()
which makes the sitter drop the promise when the context object is destroyed.