Not auto saving when exiting via hotkey

I’ve noticed that games don’t auto save state when exiting Retroarch via a hotkey from in-game. Is there a way to fix this?

Update-

I’ve tried mapping both ‘save state’ and ‘exit’ to the same button, hoping that it would save before it exits, but that doesn’t work either. I thought of mapping ‘close game’ and ‘exit’ together, but there’s no entry for closing a game.