NULLing weights when copying the pointer to prevent leaks/double-frees.