mirror of
https://github.com/Gnucash/gnucash.git
synced 2024-11-25 10:20:18 -06:00
Fix two memory leaks in QOF. Add qof_backend_destroy().
Backends should call this function to make sure they free the kvp frame for the backend configuration. git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@17058 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
parent
15d086d178
commit
733d0dfe70
@ -283,6 +283,7 @@ qsf_session_end( QofBackend *be)
|
||||
static void
|
||||
qsf_destroy_backend (QofBackend *be)
|
||||
{
|
||||
qof_backend_destroy(be);
|
||||
g_free(be);
|
||||
}
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
@ -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)
|
||||
{
|
||||
|
@ -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)
|
||||
{
|
||||
|
@ -320,6 +320,7 @@ file_session_end(QofBackend *be_start)
|
||||
static void
|
||||
file_destroy_backend(QofBackend *be)
|
||||
{
|
||||
qof_backend_destroy(be);
|
||||
g_free(be);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user