His term as president ended when he died on 17 November 1939 in Quito .
His term as president ended when he died on November 17 , 1939 in Quito from a heart attack , aged 56 .