diff --git a/libgnucash/app-utils/gnc-exp-parser.c b/libgnucash/app-utils/gnc-exp-parser.c index 35179f33a1..fdfab3aa11 100644 --- a/libgnucash/app-utils/gnc-exp-parser.c +++ b/libgnucash/app-utils/gnc-exp-parser.c @@ -32,6 +32,7 @@ #include "fin_spl_protos.h" #include "gnc-filepath-utils.h" #include "gnc-gkeyfile-utils.h" +#include "gnc-hooks.h" #include "gnc-exp-parser.h" #include "gnc-ui-util.h" #include "gnc-locale-utils.h" @@ -107,6 +108,8 @@ gnc_exp_parser_real_init ( gboolean addPredefined ) } g_free(filename); } + + gnc_hook_add_dangler(HOOK_SHUTDOWN, (GFunc)gnc_exp_parser_shutdown, NULL, NULL); } static gboolean @@ -157,6 +160,8 @@ gnc_exp_parser_shutdown (void) last_gncp_error = NO_ERR; parser_inited = FALSE; + + gnc_hook_run(HOOK_SAVE_OPTIONS, NULL); } void diff --git a/libgnucash/app-utils/gncmod-app-utils.c b/libgnucash/app-utils/gncmod-app-utils.c index 3f242d243f..24ab94d93c 100644 --- a/libgnucash/app-utils/gncmod-app-utils.c +++ b/libgnucash/app-utils/gncmod-app-utils.c @@ -66,13 +66,6 @@ lmod(char * mn) g_free(form); } -static void -app_utils_shutdown(void) -{ - gnc_exp_parser_shutdown(); - gnc_hook_run(HOOK_SAVE_OPTIONS, NULL); -} - extern SCM scm_init_sw_app_utils_module(void); @@ -85,12 +78,6 @@ libgncmod_app_utils_gnc_module_init(int refcount) lmod("(sw_app_utils)"); lmod("(gnucash app-utils)"); - if (refcount == 0) - { - gnc_hook_add_dangler(HOOK_STARTUP, (GFunc)gnc_exp_parser_init, NULL, NULL); - gnc_hook_add_dangler(HOOK_SHUTDOWN, (GFunc)app_utils_shutdown, NULL, NULL); - } - return TRUE; }