app: destroy widgets in reverse order on exit as the widgets are a stack.

This commit is contained in:
ITotalJustice
2025-08-09 11:45:13 +01:00
parent 44e1584461
commit 3404d4cece

View File

@@ -1974,7 +1974,10 @@ App::~App() {
// this has to be called before any cleanup to ensure the lifetime of // this has to be called before any cleanup to ensure the lifetime of
// nvg is still active as some widgets may need to free images. // nvg is still active as some widgets may need to free images.
m_widgets.clear(); // clear in reverse order as the widgets are a stack (todo: just use a stack?)
while (!m_widgets.empty()) {
m_widgets.pop_back();
}
nvgDeleteImage(vg, m_default_image); nvgDeleteImage(vg, m_default_image);
i18n::exit(); i18n::exit();