def METHOD_NAME(self):
    self.initMap()
    layer = self.map.getLayerByName('POLYGON')
    self.map = None
    assert str(layer.p_map).find('mapscript.mapObj') != -1
    gc.collect()
    assert layer.map is not None, layer.map