libgda r3124 - in branches/release-3-0-branch: . libgda providers/postgres
- From: murrayc svn gnome org
- To: svn-commits-list gnome org
- Subject: libgda r3124 - in branches/release-3-0-branch: . libgda providers/postgres
- Date: Mon, 7 Apr 2008 10:15:29 +0100 (BST)
Author: murrayc
Date: Mon Apr 7 10:15:28 2008
New Revision: 3124
URL: http://svn.gnome.org/viewvc/libgda?rev=3124&view=rev
Log:
2008-04-07 Murray Cumming <murrayc murrayc com>
* libgda/gda-client.c (find_or_load_provider): Do not do an extra
reference on the new GdaProvider, because we already have an initial
reference. This prevents it from being leaked, as found by valgrind.
* libgda/gda-init.c (gda_init):
* providers/postgres/libmain.c (plugin_init): Make sure that some
strings are freed before being reassigned, though these are probably not
the leaks that valgrind is reporting here.
Modified:
branches/release-3-0-branch/ChangeLog
branches/release-3-0-branch/libgda/gda-client.c
branches/release-3-0-branch/libgda/gda-init.c
branches/release-3-0-branch/providers/postgres/libmain.c
Modified: branches/release-3-0-branch/libgda/gda-client.c
==============================================================================
--- branches/release-3-0-branch/libgda/gda-client.c (original)
+++ branches/release-3-0-branch/libgda/gda-client.c Mon Apr 7 10:15:28 2008
@@ -322,6 +322,7 @@
return NULL;
}
+ /* plugin_create_provider() provides an initial reference: */
prv->provider = prv->plugin_create_provider ();
if (!prv->provider) {
emit_client_error (client, NULL,
@@ -330,8 +331,9 @@
return NULL;
}
- g_object_ref (G_OBJECT (prv->provider));
g_object_weak_ref (G_OBJECT (prv->provider), (GWeakNotify) provider_weak_cb, client);
+
+ /* Store it in our hash table so we can unref it in our finalize handler: */
g_hash_table_insert (client->priv->providers,
g_strdup (provider),
prv);
Modified: branches/release-3-0-branch/libgda/gda-init.c
==============================================================================
--- branches/release-3-0-branch/libgda/gda-init.c (original)
+++ branches/release-3-0-branch/libgda/gda-init.c Mon Apr 7 10:15:28 2008
@@ -101,8 +101,13 @@
#define LIBGDA_DICT_DTD_FILE DTDINSTALLDIR"/libgda-dict.dtd"
gda_dict_dtd = xmlParseDTD (NULL, (xmlChar*)LIBGDA_DICT_DTD_FILE);
- if (gda_dict_dtd)
+ if (gda_dict_dtd) {
+ if(gda_dict_dtd->name) {
+ g_free (gda_dict_dtd->name);
+ gda_dict_dtd->name = NULL;
+ }
gda_dict_dtd->name = xmlStrdup((xmlChar*) "gda_dict");
+ }
else
g_message (_("Could not parse " LIBGDA_DICT_DTD_FILE ": "
"XML dictionaries validation will not be performed (some weird errors may occur)"));
Modified: branches/release-3-0-branch/providers/postgres/libmain.c
==============================================================================
--- branches/release-3-0-branch/providers/postgres/libmain.c (original)
+++ branches/release-3-0-branch/providers/postgres/libmain.c Mon Apr 7 10:15:28 2008
@@ -37,8 +37,14 @@
{
/* This is never freed, but that is OK. It is only called once. */
/* But it would be nice to have some cleanup function just to shut valgrind up. murrayc. */
- if (real_path)
+ if (real_path) {
+ if(module_path) {
+ g_free (module_path);
+ module_path = NULL;
+ }
+
module_path = g_strdup (real_path);
+ }
}
const gchar *
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]