Message from C, C++ talks
I have the following problem I hope you can help me:
Inside a function (fun_a) I am creating a lamda function to use as a callback when calling another function (fun_b).
Inside the lambda function I use a variable defined in the fun_a function.
After calling the fun_b function there is a waiting time, however if this time passes the fun_a function ends.
If after the function fun_a ends the lambda function is executed, a crash is generated since the variable no longer exists since function fun_a has already finished.