gnucash maint: [assistant-stock-transaction] std::optional must be nullified

Christopher Lam clam at code.gnucash.org
Mon Sep 5 00:33:16 EDT 2022


Updated	 via  https://github.com/Gnucash/gnucash/commit/3cb9fc5d (commit)
	from  https://github.com/Gnucash/gnucash/commit/7366de94 (commit)



commit 3cb9fc5d176bd923ed1203b6167b380c79eec904
Author: Christopher Lam <christopher.lck at gmail.com>
Date:   Sun Sep 4 16:24:41 2022 +0800

    [assistant-stock-transaction] std::optional must be nullified
    
    to release memory

diff --git a/gnucash/gnome/assistant-stock-transaction.cpp b/gnucash/gnome/assistant-stock-transaction.cpp
index 798757beb..705146dd0 100644
--- a/gnucash/gnome/assistant-stock-transaction.cpp
+++ b/gnucash/gnome/assistant-stock-transaction.cpp
@@ -501,6 +501,9 @@ stock_assistant_window_destroy_cb (GtkWidget *object, gpointer user_data)
 {
     auto info = static_cast<StockTransactionInfo*>(user_data);
     gnc_unregister_gui_component_by_data (ASSISTANT_STOCK_TRANSACTION_CM_CLASS, info);
+    info->txn_types_date = std::nullopt;
+    info->txn_types = std::nullopt;
+    info->txn_type = std::nullopt;
     g_free (info);
 }
 



Summary of changes:
 gnucash/gnome/assistant-stock-transaction.cpp | 3 +++
 1 file changed, 3 insertions(+)



More information about the gnucash-changes mailing list