This is the least invasive fix.
I tired to use a shared_ptr first, but it seems like using it is incompatible with moving it to a thread and calling invoke with it as parameter.
Nevertheless, I think on the long run not creating a new Object all the time would be better.
This is the least invasive fix. I tired to use a shared_ptr first, but it seems like using it is incompatible with moving it to a thread and calling invoke with it as parameter.
Nevertheless, I think on the long run not creating a new Object all the time would be better.