SimTk/openmm — pull request #534 by swails (2014-07-15 19:43:04+00:00)
Title: [WIP] Add an explicit (shallow) copy constructor for CustomNonbondedForce.

This solves segfaults when you use the long-range dispersion correction with the
CustomNonbondedForce if the force uses TabulatedFunction objects. Basically, it
prevents the copy from taking ownership (and deleting) the functions in its
destructor.

The use cases for CustomNonbondedForce copying currently is to recompute the
long-range prefactor if the parameters change (so the CustomNonbondedForceImpl
kernels need a copy of the Force object). Doing a full (deep) copy would be a
bit slower (although would only need to be paid once for each
CustomNonbondedForce object being used).

I'm still checking it; not ready for merge yet.