Call g_module_make_resident in qof backend provider modules.

If the GncModule system finds a QofBackendProvider module M before that
has been initialized by QOF, M will register itself with QOF but does
not mark itself as resident, so the module system will unload it again,
leaving bogus pointers in QOF. Now it does.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@15320 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Andreas Köhler 2007-01-07 07:04:17 +00:00
parent ba16b67925
commit 96e1ed071d
3 changed files with 6 additions and 2 deletions

View File

@ -1287,5 +1287,6 @@ g_module_check_init(GModule *module)
prov->check_data_type = qsf_determine_file_type;
prov->provider_free = qsf_provider_free;
qof_backend_register_provider (prov);
g_module_make_resident (module);
return NULL;
}

View File

@ -392,10 +392,12 @@ qof_load_backend_library (const char *directory, const char* module_name)
g_return_val_if_fail(g_module_supported(), FALSE);
fullpath = g_module_build_path(directory, module_name);
backend = g_module_open(fullpath, G_MODULE_BIND_LAZY);
if (!backend) {
if (!backend) {
g_message ("%s: %s\n", PACKAGE, g_module_error ());
return FALSE;
}
/* the module should have done that already in g_module_check_init */
g_module_make_resident(backend);
return TRUE;
}

View File

@ -1069,8 +1069,9 @@ g_module_check_init(GModule *module)
prov->partial_book_supported = FALSE;
prov->backend_new = gnc_backend_new;
prov->provider_free = gnc_provider_free;
prov->check_data_type = gnc_determine_file_type;
prov->check_data_type = gnc_determine_file_type;
qof_backend_register_provider (prov);
g_module_make_resident (module);
return NULL;
}