libgda r3125 - in branches/libgda-3-2: . libgda providers/postgres
- From: murrayc svn gnome org
- To: svn-commits-list gnome org
- Subject: libgda r3125 - in branches/libgda-3-2: . libgda providers/postgres
- Date: Mon, 7 Apr 2008 10:18:30 +0100 (BST)
Author: murrayc
Date: Mon Apr 7 10:18:30 2008
New Revision: 3125
URL: http://svn.gnome.org/viewvc/libgda?rev=3125&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/libgda-3-2/ChangeLog
branches/libgda-3-2/libgda/gda-client.c
branches/libgda-3-2/libgda/gda-init.c
branches/libgda-3-2/providers/postgres/libmain.c
Modified: branches/libgda-3-2/libgda/gda-client.c
==============================================================================
--- branches/libgda-3-2/libgda/gda-client.c (original)
+++ branches/libgda-3-2/libgda/gda-client.c Mon Apr 7 10:18:30 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/libgda-3-2/libgda/gda-init.c
==============================================================================
--- branches/libgda-3-2/libgda/gda-init.c (original)
+++ branches/libgda-3-2/libgda/gda-init.c Mon Apr 7 10:18:30 2008
@@ -116,8 +116,13 @@
/* dictionary DTD */
file = gda_gbr_get_file_path (GDA_DATA_DIR, LIBGDA_ABI_NAME, "dtd", "libgda-dict.dtd", NULL);
gda_dict_dtd = xmlParseDTD (NULL, (xmlChar*)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 '%s': "
"XML dictionaries validation will not be performed (some weird errors may occur)"),
Modified: branches/libgda-3-2/providers/postgres/libmain.c
==============================================================================
--- branches/libgda-3-2/providers/postgres/libmain.c (original)
+++ branches/libgda-3-2/providers/postgres/libmain.c Mon Apr 7 10:18:30 2008
@@ -38,8 +38,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]