mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Fix test-backend-dbi segfault with libdbi-0.9.0.
dbi_inst must be initialized before it can be used.
This commit is contained in:
parent
551e5c6093
commit
e4d97f6d74
@ -36,7 +36,7 @@
|
|||||||
|
|
||||||
#if LIBDBI_VERSION >= 900
|
#if LIBDBI_VERSION >= 900
|
||||||
#define HAVE_LIBDBI_R 1
|
#define HAVE_LIBDBI_R 1
|
||||||
static dbi_inst dbi_instance;
|
static dbi_inst dbi_instance = NULL;
|
||||||
#else
|
#else
|
||||||
#define HAVE_LIBDBI_R 0
|
#define HAVE_LIBDBI_R 0
|
||||||
#endif
|
#endif
|
||||||
@ -597,8 +597,11 @@ test_suite_gnc_backend_dbi (void)
|
|||||||
dbi_driver driver = NULL;
|
dbi_driver driver = NULL;
|
||||||
GList *drivers = NULL;
|
GList *drivers = NULL;
|
||||||
#if HAVE_LIBDBI_R
|
#if HAVE_LIBDBI_R
|
||||||
|
if (dbi_instance == NULL)
|
||||||
|
dbi_initialize_r (NULL, &dbi_instance);
|
||||||
while ((driver = dbi_driver_list_r (driver, dbi_instance)))
|
while ((driver = dbi_driver_list_r (driver, dbi_instance)))
|
||||||
#else
|
#else
|
||||||
|
dbi_initialize (NULL);
|
||||||
while ((driver = dbi_driver_list (driver)))
|
while ((driver = dbi_driver_list (driver)))
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user