Studio should ask for confirmation when clicking on the discard changes button with a dialog:
"Any unsaved change in this screen will be lost. Continue?"
Clicking yes should discard changes.
Clicking no should cancel the discard (i.e. close the dialog and don't do anything).
In case the screen is left without saving changes, clicking on discard changes should not prompt for another confirmation since the risk to choose the wrong button is lower here, and that might become annoying to have two dialogs in a row.