Call the correct destroy function.