Skip to content

Free PrecollisionIntercator in Destructor

As discussed in #179 (closed), it is safer to free the data allocated for the PreCollisionInteractors in their destructor. However, because that requires a pointer to para and the cudaMemoryManager, I had to assign each collisionInteractor a shared pointer to both, para and cudaMemoryManager. I also introduced a new function in the PrecollisionInteractor, initInteractor, that assigns the shared pointers and then calls the init method overridden in the subclasses. I did this so that the constructors of the subclasses don't have to be polluted with additional parameters. I made the init functions of the subclasses private so that they cannot be called without calling initInteractor first.

Merge request reports