Commit 1a016487 authored by Krzysztof Leśniak's avatar Krzysztof Leśniak
Browse files

Fix lifetime issue

There's possible lifetime issue with objects_name variable. This
variable is passed as argument by reference and it's captured in a
lambda, also by reference. Then, the lambda is returned. This caused the
object to be used after ended its lifetime when passed to ilog function.
This resulted in logic_error exception being thrown from std::string
constructor.
To fix this, change the function to take the variable by copy and then
move into lambda capture.
While here, also change capture of description variable to be copied. This
seems to work fine, but I'm not sure if it's guaranteed, considering
we're capturing it and also moving as a argument at the same time.
parent 4847fa6e
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment