The previous implementation used a shallow copy, which is incorrect and could lead to a use-after-free.
For more information you can find the documentation for this library online.