Fix memory leak by overriding base class's destructor