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

This commit is contained in:
ITotalJustice committed 2025-08-09 11:45:13 +01:00
1 parent 44e1584461
commit 3404d4cece
1 file changed
+4 -1
+4 -1
View File
@@ -1974,7 +1974,10 @@ App::~App() {
// 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.
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);
i18n::exit();