Lousy example. Cornwallis' surrender didn't end the war. It just surrendered the British army. The war ended when the Treaty of Paris was signed.
Santa Anna's surrender (at San Jacinto several weeks earlier) didn't secure Texas' independence. It just surrendered the Mexican army. Independence was secured when the Treaty of Velasco was signed. Looks like the analogy fits to me!