Application Closing Event

How do i get the application closing or stopping(in the editor) event.

I’m running red dwarf but am not getting forcefully logged out when hitting stop in the unity editor.

I want to call logout when the app closes or is stopped in unity.

!Application.IsPlaying doesn’t work.

Rob

ahh found it

function OnApplicationQuit () : void