Fix broken test-backend-dbi with libdbi 0.9.

Segfaulted for an uninitialized dbi_instance.
This commit is contained in:
John Ralls 2014-08-07 10:00:39 -07:00
parent b465fef9ac
commit 321a159af2
2 changed files with 5 additions and 2 deletions

View File

@ -34,7 +34,7 @@ GNUCASH_NANO_VERSION=0
#src/backend/dbi/gnc-backend-dbi.c:gnc_dbi_load.
GNUCASH_RESAVE_VERSION=19920
# Initialize automake -- make sure we have at least version 1.9
AM_INIT_AUTOMAKE([1.9 dist-bzip2])
AM_INIT_AUTOMAKE([1.9 dist-bzip2 subdir-objects])
# Parse out the version number
GNUCASH_VERSION_STRING=AC_PACKAGE_VERSION

View File

@ -36,7 +36,7 @@
#if LIBDBI_VERSION >= 900
#define HAVE_LIBDBI_R 1
static dbi_inst dbi_instance;
static dbi_inst dbi_instance = NULL;
#else
#define HAVE_LIBDBI_R 0
#endif
@ -597,8 +597,11 @@ test_suite_gnc_backend_dbi (void)
dbi_driver driver = NULL;
GList *drivers = NULL;
#if HAVE_LIBDBI_R
if (dbi_instance == NULL)
dbi_initialize_r (NULL, &dbi_instance);
while ((driver = dbi_driver_list_r (driver, dbi_instance)))
#else
dbi_initialize (NULL);
while ((driver = dbi_driver_list (driver)))
#endif
{