Skip to content

feat(...): Ensure the QApplication is really the last thing destroyed

Didier WECKMANN requested to merge fortify-app-closing into dev

What does this MR do?

This MR is just a small safeguard when closing an application would lead to a crash like when we merged https://gitlab.lan.local/Sight/sight/merge_requests/15 and forgetting to call appmanager.reset(). Granted, with it, there is no crash, but as the QApplication must absolutely be the last destroyed, ensuring to delete it in the last event on the Qt event loop is not bad.

It also ensure that we do not create QDesktopWidget in a loop as this class is supposed to be a singleton hold by the QApplication.

How to test it?

remove the appmanager.reset()in Samples/Tutorials/Tuto09GenericSceneCpp/src/Tuto09GenericSceneCpp/Plugin.cpp. Observe the crash without the MR

Merge request reports