You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It is entirely unsafe, since it can return a value that will then be deleted from another thread, before the one who called pullValue has the time to clone it.
Hence one should always do :
address->pullValue();
auto theValue = address->cloneValue();
For the same reasons, getValue() should not be used (maybe cloneValue should become getValue ?).
Another safe option would be to store the value in a shared_ptr and change the API to return it as a shared_ptr, but I don't know what would be the best performance-wise between these two options.
The text was updated successfully, but these errors were encountered:
It is entirely unsafe, since it can return a value that will then be deleted from another thread, before the one who called
pullValue
has the time to clone it.Hence one should always do :
For the same reasons,
getValue()
should not be used (maybe cloneValue should become getValue ?).Another safe option would be to store the value in a
shared_ptr
and change the API to return it as ashared_ptr
, but I don't know what would be the best performance-wise between these two options.The text was updated successfully, but these errors were encountered: