Window close and before render callbacks