When Sebastian of Portugal died, he was succeeded by his grand-uncle Henry. Henry asked Pope Gregory XIII to release him from his vows so that he could take a wife and continue the dynasty. He refused so he wouldn't anger Philip II. Imagine that he had, would that continue the Aviz dynasty or would Philip still end up succeeding him anyway?