Added destructor

If I try deleting the original pointer, it causes a crash, saying the pointer is invalid. Or perhaps that's because I've deleted the pointer in the test; more experiments are required.