tracker r2597 - in branches/turtle: . src/libtracker-data
- From: pvanhoof svn gnome org
- To: svn-commits-list gnome org
- Subject: tracker r2597 - in branches/turtle: . src/libtracker-data
- Date: Thu, 27 Nov 2008 14:41:35 +0000 (UTC)
Author: pvanhoof
Date: Thu Nov 27 14:41:35 2008
New Revision: 2597
URL: http://svn.gnome.org/viewvc/tracker?rev=2597&view=rev
Log:
2008-11-27 Philip Van Hoof <philip codeminded be>
* turtle/src/libtracker-data/tracker-data-metadata.c: Memory leaks
when overwriting predicates in TrackerDataMetadata
Modified:
branches/turtle/ChangeLog
branches/turtle/src/libtracker-data/tracker-data-metadata.c
Modified: branches/turtle/src/libtracker-data/tracker-data-metadata.c
==============================================================================
--- branches/turtle/src/libtracker-data/tracker-data-metadata.c (original)
+++ branches/turtle/src/libtracker-data/tracker-data-metadata.c Thu Nov 27 14:41:35 2008
@@ -100,6 +100,7 @@
gchar *value)
{
TrackerField *field;
+ gchar *old_value;
field = tracker_ontology_get_field_by_name (field_name);
@@ -111,6 +112,9 @@
g_return_if_fail (tracker_field_get_multiple_values (field) == FALSE);
+ old_value = g_hash_table_lookup (metadata->table, field);
+ g_free (old_value);
+
g_hash_table_replace (metadata->table,
g_object_ref (field),
value);
@@ -167,12 +171,20 @@
GList *list)
{
TrackerField *field;
+ GList *old_values;
field = tracker_ontology_get_field_by_name (field_name);
g_return_if_fail (TRACKER_IS_FIELD (field));
g_return_if_fail (tracker_field_get_multiple_values (field) == TRUE);
+ old_values = g_hash_table_lookup (metadata->table, field);
+
+ if (old_values) {
+ g_list_foreach (old_values, (GFunc) g_free, NULL);
+ g_list_free (old_values);
+ }
+
g_hash_table_replace (metadata->table,
g_object_ref (field),
list);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]