From 4711e8fafa7d07bcde819f99ed36328f7ed2f0f4 Mon Sep 17 00:00:00 2001 From: Christopher Lam Date: Tue, 27 Aug 2024 08:32:44 +0800 Subject: [PATCH] fixup! delete ns_vec members in reverse --- libgnucash/engine/gnc-commodity.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libgnucash/engine/gnc-commodity.cpp b/libgnucash/engine/gnc-commodity.cpp index 511bde5471b..21058e54064 100644 --- a/libgnucash/engine/gnc-commodity.cpp +++ b/libgnucash/engine/gnc-commodity.cpp @@ -2198,8 +2198,8 @@ gnc_commodity_table_destroy(gnc_commodity_table * t) if (!t) return; ENTER ("table=%p", t); - for (auto ns : t->ns_vec) - gnc_commodity_table_delete_namespace(t, ns->name); + for (auto ns = t->ns_vec.rbegin(); ns != t->ns_vec.rend(); ++ns) + gnc_commodity_table_delete_namespace(t, (*ns)->name); t->ns_vec.~CommNSVec (); t->ns_table.~StringCommNSMap ();