Pointer ownership should be clarified using, e.g., std::unique_ptr. Right now, scratch pointers are being passed around all over the place, and it's not clear what the chain of ownership is. (The pointers are also just NULLed at the end, without any deletes.)
Pointer ownership should be clarified using, e.g.,
std::unique_ptr
. Right now,scratch
pointers are being passed around all over the place, and it's not clear what the chain of ownership is. (The pointers are also justNULL
ed at the end, without anydelete
s.)