Search Issue Tracker

Active

Votes

2

Found in

2018.4

2019.4.2f1

2020.2

Issue ID

1261125

Regression

No

OnApplicationQuit method is called before Application.wantsToQuit event is raised

Scripting

-

How to reproduce:
1. Open user's attached "quit_test 2019.4.zip" project
2. Open "SampleScene" Scene
3. Enter Play Mode
4. Exit Play Mode
5. Observe the Console log

Expected result: Application.wantsToQuit event is raised before OnApplicationQuit, if false is returned, no GameObjects are destroyed
Actual result: OnApplicationQuit is called before Application.wantsToQuit event is raised. Even if Application.wantsToQuitt returns false, most GameObjects are still destroyed in the OnApplicationQuit method because is called before the Application.wantsToQuit event

Reproducible with: 2018.4.24f1, 2019.4.3f1, 2020.1.0b15, 2020.2.0a17

Notes:
- The issue is also reproducible on Windows and Mac player, which can be seen in the Player log
- Added a video for reference showing the behavior with GameObjects being destroyed, even if Application.wantsToQuit is false

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.