'Free the memory used by the C++ object.'

def __del__(self):

    if (self.destructor and self._ptr):
        try:
            self.destructor(self.ptr)
        except (AttributeError, TypeError):
            pass
