shes captured by the inquisition , tried as a witch and sentenced to execution , but her father , the king of the sea , rescues her and grants her one last word with hans before wiping her memory clear of him and returning her to the sea .