| 63 | } |
| 64 | |
| 65 | void Application::terminating() |
| 66 | { |
| 67 | if (_appControllerBeginLaunchCalled) { |
| 68 | _applicationController->onTerminate(); |
| 69 | } |
| 70 | |
| 71 | // the main dispatcher may still contain some pending items. However, |
| 72 | // when we return from terminating then the destruction of global |
| 73 | // variables may begin almost immediately. Since the app runner/ holds a |
| 74 | // reference to the dispatcher, that means that any objects referenced |
| 75 | // in pending work items will be destroyed with the app runner if we do |
| 76 | // nothing. And since the app runner is created first, it will be |
| 77 | // destroyed last. Which means that if the object's destructors access |
| 78 | // any global objects then those might already be destroyed and we can |
| 79 | // get a crash. |
| 80 | disposeMainDispatcher(); |
| 81 | |
| 82 | platformSpecificCleanup(); |
| 83 | |
| 84 | setGlobalApplication(nullptr); |
| 85 | } |
| 86 | } |
nothing calls this directly
no test coverage detected