opensim-core icon indicating copy to clipboard operation
opensim-core copied to clipboard

Remove setMemomryOwner from the public interface of OpenSim::ArrayPtrs

Open aymanhab opened this issue 3 years ago • 0 comments

As explained in https://github.com/opensim-org/opensim-core/issues/3274 and as evident by the list of issues/PRs due to leaks or crashes due to the use of this flag, this is practically giving users a way to shoot themselves in the foot. The proposal here is to:

  1. Remove the setMemoryOwner from the public interface.
  2. Make the code behave as setMemoryOwner is set to true when ownership is the desired behavior
  3. Move clients to a container of shared_ptrs when ownership is not the desired behavior (I don't think there're instances of the code where the flag changes during runtime anyway so the flag's correct settings is known on construction.
  4. Remove the flag altogether.

aymanhab avatar Aug 09 '22 20:08 aymanhab