Ah yes there are ways around it, currently i simply save the file every 3 seconds, in my use case I have a timer that ticks as the game is playing and the timer has to continue where it left off when the game is relaunched, so I was saving when certain actions happened in game and when the user quit the game (properly). As I cannot capture the user pressing the window close button it left a gap, as the timer does not need to be correct to the very seconds I have worked around it.
Would be nice to instead of the program closing with the 'x' it just returned an AppTerminated() function or similar and allow the programmer to decide what happens. Maybe I'll suggest it.