Hello,
I have a function which is called by an asynchronous timer. So this runs in a seperate thread then my main function.
Now in this timer callback I use a PostDeferredCallback to trigger another callback and let it run in the main thread.
Now when I pass the void pointer with the callback data to the deferred function it works great in debug mode and not in release mode.
I already figured out that this is because the data where the void pointer is pointing to is already discarded because the function (of the asychronous timer) was already finished.
In debug mode the program runs a little slower and then the data is not yet discarded.
Now my question is: How can I solve this problem?
I could make my callback data a global variable but I don't really like this solution.
My callback data is a struct. Is there no way to pass the complete datastructure instead of a pointer?
Thanks for your help