Put the getObject method in const mode, free the map in the destructor