mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Bug 799437 - Crash deleting and recreating an SX with the scheduled transaction editor open
When deleting and recreating a scheduled transaction with the scheduled transaction editor open a crash occurs. This is due to incorrectly adding the deleted SX's to the 'selected_list' in the function gnc_plugin_page_sx_list_cmd_delete.
This commit is contained in:
parent
3dd60e904c
commit
5a71d7ad15
@ -873,6 +873,9 @@ _destroy_sx(gpointer data, gpointer user_data)
|
|||||||
QofBook *book;
|
QofBook *book;
|
||||||
book = gnc_get_current_book ();
|
book = gnc_get_current_book ();
|
||||||
sxes = gnc_book_get_schedxactions (book);
|
sxes = gnc_book_get_schedxactions (book);
|
||||||
|
|
||||||
|
DEBUG("deleting sx [%s]", xaccSchedXactionGetName (sx));
|
||||||
|
|
||||||
gnc_sxes_del_sx (sxes, sx);
|
gnc_sxes_del_sx (sxes, sx);
|
||||||
gnc_sx_begin_edit (sx);
|
gnc_sx_begin_edit (sx);
|
||||||
xaccSchedXactionDestroy (sx);
|
xaccSchedXactionDestroy (sx);
|
||||||
@ -935,11 +938,7 @@ gnc_plugin_page_sx_list_cmd_delete (GSimpleAction *simple,
|
|||||||
if (gnc_verify_dialog (window, FALSE, "%s", message))
|
if (gnc_verify_dialog (window, FALSE, "%s", message))
|
||||||
{
|
{
|
||||||
gppsl_update_selected_list (plugin_page, TRUE, NULL);
|
gppsl_update_selected_list (plugin_page, TRUE, NULL);
|
||||||
for (GList *list = to_delete; list != NULL; list = list->next)
|
|
||||||
{
|
|
||||||
DEBUG("to-delete [%s]\n", xaccSchedXactionGetName (GNC_SCHEDXACTION(list->data)));
|
|
||||||
gppsl_update_selected_list (plugin_page, FALSE, GNC_SCHEDXACTION(list->data));
|
|
||||||
}
|
|
||||||
g_list_foreach (to_delete, (GFunc)_destroy_sx, NULL);
|
g_list_foreach (to_delete, (GFunc)_destroy_sx, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user