r17230 - gnucash/branches/gda-dev2 - 1) Merge trunk through 17229 (memory leak fixes)

Phil Longstaff plongstaff at cvs.gnucash.org
Thu Jun 12 20:53:43 EDT 2008


Author: plongstaff
Date: 2008-06-12 20:53:43 -0400 (Thu, 12 Jun 2008)
New Revision: 17230
Trac: http://svn.gnucash.org/trac/changeset/17230

Modified:
   gnucash/branches/gda-dev2/configure.in
   gnucash/branches/gda-dev2/lib/libqof/qof/qofsession.c
   gnucash/branches/gda-dev2/src/backend/file/gnc-schedxaction-xml-v2.c
   gnucash/branches/gda-dev2/src/bin/Makefile.am
   gnucash/branches/gda-dev2/src/bin/gnucash-gdb.in
   gnucash/branches/gda-dev2/src/bin/gnucash-valgrind.in
   gnucash/branches/gda-dev2/src/bin/gnucash.in
Log:
1) Merge trunk through 17229 (memory leak fixes)
2) The DBI backend expects environment variable GNC_DBD_DIR to be the
location of the drivers.  If not set, the DBI backend will use /usr/lib/dbd.
Add --with-dbi-dbd-dir=PATH (default /usr/lib/dbd) to configure.in and set
the environment variable in the run scripts.


Modified: gnucash/branches/gda-dev2/configure.in
===================================================================
--- gnucash/branches/gda-dev2/configure.in	2008-06-13 00:24:33 UTC (rev 17229)
+++ gnucash/branches/gda-dev2/configure.in	2008-06-13 00:53:43 UTC (rev 17230)
@@ -638,6 +638,11 @@
 then
   AC_CHECK_HEADERS(dbi/dbi.h)
   if test "x$ac_cv_header_dbi_dbi_h" != xno; then
+    AC_ARG_WITH( dbi-dbd-dir,
+      [AS_HELP_STRING([--with-dbi-dbd-dir=PATH],[specify location of libdbi drivers @<:@default=/usr/lib/dbd@:>@])],
+      GNC_DBD_DIR="$with_dbi_dbd_dir",
+      GNC_DBD_DIR="/usr/lib/dbd")
+
     LIBDBI_LIBS=-ldbi
     DBI_DIR=dbi
   else
@@ -646,6 +651,7 @@
 fi
 AC_SUBST(LIBDBI_LIBS)
 AC_SUBST(DBI_DIR)
+AC_SUBST(GNC_DBD_DIR)
 
 ### --------------------------------------------------------------------------
 ### Variables

Modified: gnucash/branches/gda-dev2/lib/libqof/qof/qofsession.c
===================================================================
--- gnucash/branches/gda-dev2/lib/libqof/qof/qofsession.c	2008-06-13 00:24:33 UTC (rev 17229)
+++ gnucash/branches/gda-dev2/lib/libqof/qof/qofsession.c	2008-06-13 00:53:43 UTC (rev 17230)
@@ -1287,6 +1287,7 @@
 					{
 						PWARN("%s", msg);
 						g_free(msg);
+						msg = NULL;
 					}
 				}
 				/* Tell the books about the backend that they'll be using. */
@@ -1347,6 +1348,7 @@
 	}
 	LEAVE("error -- No backend!");
  leave:
+ 	if(msg != NULL) g_free(msg);
 	g_atomic_int_inc(&session->lock);
 	return;
 }

Modified: gnucash/branches/gda-dev2/src/backend/file/gnc-schedxaction-xml-v2.c
===================================================================
--- gnucash/branches/gda-dev2/src/backend/file/gnc-schedxaction-xml-v2.c	2008-06-13 00:24:33 UTC (rev 17229)
+++ gnucash/branches/gda-dev2/src/backend/file/gnc-schedxaction-xml-v2.c	2008-06-13 00:53:43 UTC (rev 17230)
@@ -414,12 +414,15 @@
     struct sx_pdata *pdata = sx_pdata;
     SchedXaction *sx = pdata->sx;
     GList *schedule;
+	gchar* debug_str;
 
     g_return_val_if_fail( node, FALSE );
 
     schedule = dom_tree_freqSpec_to_recurrences(node, pdata->book);
     gnc_sx_set_schedule(sx, schedule);
-    g_debug("parsed from freqspec [%s]", recurrenceListToString(schedule));
+    debug_str = recurrenceListToString(schedule);
+    g_debug("parsed from freqspec [%s]", debug_str);
+	g_free(debug_str);
 
     _fixup_recurrence_start_dates(xaccSchedXactionGetStartDate(sx), schedule);
     pdata->saw_freqspec = TRUE;
@@ -451,13 +454,16 @@
 {
     struct sx_pdata *parsing_data = _pdata;
     GList *schedule = NULL;
+	gchar* debug_str;
      
     g_return_val_if_fail(node, FALSE);
 
     if (!dom_tree_generic_parse(node, sx_recurrence_list_handlers, &schedule))
         return FALSE;
     // g_return_val_if_fail(schedule, FALSE);
-    g_debug("setting freshly-parsed schedule: [%s]", recurrenceListToString(schedule));
+    debug_str = recurrenceListToString(schedule);
+    g_debug("setting freshly-parsed schedule: [%s]", debug_str);
+	g_free(debug_str);
     gnc_sx_set_schedule(parsing_data->sx, schedule);
     parsing_data->saw_recurrence = TRUE;
     return TRUE;

Modified: gnucash/branches/gda-dev2/src/bin/Makefile.am
===================================================================
--- gnucash/branches/gda-dev2/src/bin/Makefile.am	2008-06-13 00:24:33 UTC (rev 17229)
+++ gnucash/branches/gda-dev2/src/bin/Makefile.am	2008-06-13 00:53:43 UTC (rev 17230)
@@ -32,6 +32,7 @@
 	rm -f $@.tmp
 	sed < $< > $@.tmp \
 	    -e 's#@-BIN_DIR-@#${bindir}#g' \
+		-e 's#@-GNC_DBD_DIR-@#${GNC_DBD_DIR}#g' \
 	    -e 's#@-GNC_GUILE_MODULE_DIR-@#${GNC_SHAREDIR}/guile-modules#g' \
 	    -e 's#@-GNC_SCM_INSTALL_DIR-@#${GNC_SCM_INSTALL_DIR}#g' \
             -e 's#@-GNC_LIB_INSTALLDIR-@#${libdir}#' \
@@ -44,6 +45,7 @@
 	rm -f $@.tmp
 	sed < $< > $@.tmp \
 	    -e 's#@-BIN_DIR-@#${bindir}#g' \
+		-e 's#@-GNC_DBD_DIR-@#${GNC_DBD_DIR}#g' \
 	    -e 's#@-GNC_GUILE_MODULE_DIR-@#${GNC_SHAREDIR}/guile-modules#g' \
 	    -e 's#@-GNC_SCM_INSTALL_DIR-@#${GNC_SCM_INSTALL_DIR}#g' \
             -e 's#@-GNC_LIB_INSTALLDIR-@#${libdir}#' \
@@ -56,6 +58,7 @@
 	rm -f $@.tmp
 	sed < $< > $@.tmp \
 	    -e 's#@-BIN_DIR-@#${bindir}#g' \
+		-e 's#@-GNC_DBD_DIR-@#${GNC_DBD_DIR}#g' \
 	    -e 's#@-GNC_GUILE_MODULE_DIR-@#${GNC_SHAREDIR}/guile-modules#g' \
 	    -e 's#@-GNC_SCM_INSTALL_DIR-@#${GNC_SCM_INSTALL_DIR}#g' \
             -e 's#@-GNC_LIB_INSTALLDIR-@#${libdir}#' \

Modified: gnucash/branches/gda-dev2/src/bin/gnucash-gdb.in
===================================================================
--- gnucash/branches/gda-dev2/src/bin/gnucash-gdb.in	2008-06-13 00:24:33 UTC (rev 17229)
+++ gnucash/branches/gda-dev2/src/bin/gnucash-gdb.in	2008-06-13 00:53:43 UTC (rev 17230)
@@ -18,10 +18,12 @@
 
 LD_LIBRARY_PATH="${EXTRA_LIBS}:${LD_LIBRARY_PATH}"
 TOP_SRC_DIR="@-TOP_SRC_DIR-@"
+GNC_DBD_DIR="@-GNC_DBD_DIR-@"
 
 export GNC_MODULE_PATH
 export GUILE_LOAD_PATH
 export LD_LIBRARY_PATH
+export GNC_DBD_DIR
 
 #
 # Other potentially useful options, particularly for valgrind-2.x:

Modified: gnucash/branches/gda-dev2/src/bin/gnucash-valgrind.in
===================================================================
--- gnucash/branches/gda-dev2/src/bin/gnucash-valgrind.in	2008-06-13 00:24:33 UTC (rev 17229)
+++ gnucash/branches/gda-dev2/src/bin/gnucash-valgrind.in	2008-06-13 00:53:43 UTC (rev 17230)
@@ -18,10 +18,12 @@
 
 LD_LIBRARY_PATH="${EXTRA_LIBS}:${LD_LIBRARY_PATH}"
 TOP_SRC_DIR="@-TOP_SRC_DIR-@"
+GNC_DBD_DIR="@-GNC_DBD_DIR-@"
 
 export GNC_MODULE_PATH
 export GUILE_LOAD_PATH
 export LD_LIBRARY_PATH
+export GNC_DBD_DIR
 
 #
 # Other potentially useful options, particularly for valgrind-2.x:

Modified: gnucash/branches/gda-dev2/src/bin/gnucash.in
===================================================================
--- gnucash/branches/gda-dev2/src/bin/gnucash.in	2008-06-13 00:24:33 UTC (rev 17229)
+++ gnucash/branches/gda-dev2/src/bin/gnucash.in	2008-06-13 00:53:43 UTC (rev 17230)
@@ -18,10 +18,12 @@
 
 LD_LIBRARY_PATH="${EXTRA_LIBS}@-PATH_SEPARATOR-@${LD_LIBRARY_PATH}"
 DYLD_LIBRARY_PATH="${EXTRA_LIBS}@-PATH_SEPARATOR-@${DYLD_LIBRARY_PATH}"
+GNC_DBD_DIR="@-GNC_DBD_DIR-@"
 
 export GNC_MODULE_PATH
 export GUILE_LOAD_PATH
 export LD_LIBRARY_PATH
 export DYLD_LIBRARY_PATH
+export GNC_DBD_DIR
 
 exec gnucash-bin "$@"



More information about the gnucash-changes mailing list