Clicking the "X" on the upper-right corner of Touch

… closes the app instantly without asking you if you want to save changes.

go to Edit/Preferences and enable the “Prompt to Save on Exit” option to bring up a dialog before TouchDesigner closes.

cheers
markus