Merge Jean Laroche's '797670_Xtran_editor_crash' into maint.

https://github.com/Gnucash/gnucash/pull/686
This commit is contained in:
John Ralls 2020-04-25 14:17:28 -07:00
commit 31daba151c
2 changed files with 19 additions and 6 deletions

View File

@ -62,6 +62,7 @@
#include "gnc-ui.h" #include "gnc-ui.h"
#include "gnc-ui-util.h" #include "gnc-ui-util.h"
#include "gnucash-sheet.h" #include "gnucash-sheet.h"
#include "gnc-session.h"
#include "gnc-split-reg.h" #include "gnc-split-reg.h"
@ -1123,6 +1124,7 @@ gnc_ui_scheduled_xaction_editor_dialog_create (GtkWindow *parent,
GtkBuilder *builder; GtkBuilder *builder;
GtkWidget *button; GtkWidget *button;
int i; int i;
int id;
GList *dlgExists = NULL; GList *dlgExists = NULL;
static struct widgetSignalCallback static struct widgetSignalCallback
@ -1208,10 +1210,12 @@ gnc_ui_scheduled_xaction_editor_dialog_create (GtkWindow *parent,
TRUE, TRUE, 0 ); TRUE, TRUE, 0 );
} }
gnc_register_gui_component( DIALOG_SCHEDXACTION_EDITOR_CM_CLASS, id = gnc_register_gui_component( DIALOG_SCHEDXACTION_EDITOR_CM_CLASS,
NULL, /* no refresh handler */ NULL, /* no refresh handler */
sxed_close_handler, sxed_close_handler,
sxed ); sxed );
// This ensure this dialog is closed when the session is closed.
gnc_gui_component_set_session (id, gnc_get_current_session());
g_signal_connect( sxed->dialog, "delete_event", g_signal_connect( sxed->dialog, "delete_event",
G_CALLBACK(sxed_delete_event), sxed ); G_CALLBACK(sxed_delete_event), sxed );

View File

@ -51,9 +51,10 @@
#include "import-pending-matches.h" #include "import-pending-matches.h"
#include "gnc-component-manager.h" #include "gnc-component-manager.h"
#include "guid.h" #include "guid.h"
#include "gnc-session.h"
#define GNC_PREFS_GROUP "dialogs.import.generic.transaction-list" #define GNC_PREFS_GROUP "dialogs.import.generic.transaction-list"
#define IMPORT_MAIN_MATCHER_CM_CLASS "transaction-matcher-dialog"
struct _main_matcher_info struct _main_matcher_info
{ {
@ -923,6 +924,7 @@ GNCImportMainMatcher *gnc_gen_trans_list_new (GtkWidget *parent,
GtkStyleContext *stylectxt; GtkStyleContext *stylectxt;
GdkRGBA color; GdkRGBA color;
GtkWidget *button; GtkWidget *button;
gint id;
info = g_new0 (GNCImportMainMatcher, 1); info = g_new0 (GNCImportMainMatcher, 1);
info->pending_matches = gnc_import_PendingMatches_new(); info->pending_matches = gnc_import_PendingMatches_new();
@ -978,6 +980,13 @@ GNCImportMainMatcher *gnc_gen_trans_list_new (GtkWidget *parent,
g_object_unref (G_OBJECT(builder)); g_object_unref (G_OBJECT(builder));
// Register this UI, it needs to be closed when the session is closed.
id = gnc_register_gui_component (IMPORT_MAIN_MATCHER_CM_CLASS,
NULL, /* no refresh handler */
(GNCComponentCloseHandler)gnc_gen_trans_list_delete,
info);
// This ensure this dialog is closed when the session is closed.
gnc_gui_component_set_session (id, gnc_get_current_session());
return info; return info;
} }