diff --git a/lib/libqof/backend/file/qsf-backend.c b/lib/libqof/backend/file/qsf-backend.c index 63072644b8..5bc83365a6 100644 --- a/lib/libqof/backend/file/qsf-backend.c +++ b/lib/libqof/backend/file/qsf-backend.c @@ -283,6 +283,7 @@ qsf_session_end( QofBackend *be) static void qsf_destroy_backend (QofBackend *be) { + qof_backend_destroy(be); g_free(be); } diff --git a/lib/libqof/qof/qofbackend-p.h b/lib/libqof/qof/qofbackend-p.h index cb128219bf..fab49a784b 100644 --- a/lib/libqof/qof/qofbackend-p.h +++ b/lib/libqof/qof/qofbackend-p.h @@ -377,6 +377,7 @@ void qof_backend_set_message(QofBackend *be, const char *format, ...); char * qof_backend_get_message(QofBackend *be); void qof_backend_init(QofBackend *be); +void qof_backend_destroy(QofBackend *be); /** Allow backends to see if the book is open diff --git a/lib/libqof/qof/qofbackend.c b/lib/libqof/qof/qofbackend.c index 4f70aa3887..e0a2dd4fbc 100644 --- a/lib/libqof/qof/qofbackend.c +++ b/lib/libqof/qof/qofbackend.c @@ -144,6 +144,15 @@ qof_backend_init(QofBackend *be) be->export = NULL; } +void +qof_backend_destroy(QofBackend *be) +{ + g_free(be->error_msg); + be->error_msg = NULL; + kvp_frame_delete(be->backend_configuration); + be->backend_configuration = NULL; +} + void qof_backend_run_begin(QofBackend *be, QofInstance *inst) { diff --git a/lib/libqof/qof/qoflog.c b/lib/libqof/qof/qoflog.c index 932139906a..1da32bd8a4 100644 --- a/lib/libqof/qof/qoflog.c +++ b/lib/libqof/qof/qoflog.c @@ -128,7 +128,8 @@ void qof_log_init_filename(const gchar* log_filename) { if (log_table == NULL) - log_table = g_hash_table_new(g_str_hash, g_str_equal); + log_table = g_hash_table_new_full(g_str_hash, g_str_equal, + g_free, NULL); if (log_filename) { diff --git a/src/backend/file/gnc-backend-file.c b/src/backend/file/gnc-backend-file.c index 8b086f7106..d1c8d57bdd 100644 --- a/src/backend/file/gnc-backend-file.c +++ b/src/backend/file/gnc-backend-file.c @@ -320,6 +320,7 @@ file_session_end(QofBackend *be_start) static void file_destroy_backend(QofBackend *be) { + qof_backend_destroy(be); g_free(be); }