[API] free pointer in destructor