gtranslator r3752 - in trunk/src: . translation-memory translation-memory/berkeley
- From: icq svn gnome org
- To: svn-commits-list gnome org
- Subject: gtranslator r3752 - in trunk/src: . translation-memory translation-memory/berkeley
- Date: Mon, 22 Sep 2008 09:46:47 +0000 (UTC)
Author: icq
Date: Mon Sep 22 09:46:47 2008
New Revision: 3752
URL: http://svn.gnome.org/viewvc/gtranslator?rev=3752&view=rev
Log:
2008-09-02 Ignacio Casal Quinteiro <nacho resa gmail com>
* draw-spaces.c (draw_tabs_and_spaces):
* po.c (gtranslator_po_init), (gtranslator_po_parse):
* translation-memory/berkeley/berkeley.c
(gtranslator_berkeley_store), (gtranslator_berkeley_lookup):
* translation-memory/translation-memory-ui.c
(showed_message_cb),
(tree_view_size_cb):
* utils.c (check_good_word),
(gtranslator_utils_split_string_in_words):
Fixed lots of memory leaks. Thanks to Josà Dapena Paz.
Modified:
trunk/src/ChangeLog
trunk/src/draw-spaces.c
trunk/src/po.c
trunk/src/translation-memory/berkeley/berkeley.c
trunk/src/translation-memory/translation-memory-ui.c
trunk/src/utils.c
Modified: trunk/src/draw-spaces.c
==============================================================================
--- trunk/src/draw-spaces.c (original)
+++ trunk/src/draw-spaces.c Mon Sep 22 09:46:47 2008
@@ -163,4 +163,6 @@
if(!gtk_text_iter_forward_char(&iter))
break;
}
+
+ cairo_destroy (cr);
}
Modified: trunk/src/po.c
==============================================================================
--- trunk/src/po.c (original)
+++ trunk/src/po.c Mon Sep 22 09:46:47 2008
@@ -180,6 +180,7 @@
po->priv = GTR_PO_GET_PRIVATE (po);
po->priv->location = NULL;
+ po->priv->gettext_po_file = NULL;
}
static void
@@ -344,6 +345,9 @@
po->priv->location = g_file_dup (location);
filename = g_file_get_path (location);
+ if (po->priv->gettext_po_file)
+ po_file_free (po->priv->gettext_po_file);
+
priv->gettext_po_file = po_file_read (filename,
&handler);
if (priv->gettext_po_file == NULL)
@@ -366,7 +370,7 @@
g_set_error(error,
GTR_PO_ERROR,
GTR_PO_ERROR_RECOVERY,
- message_error);
+ "%s", message_error);
}
if (po_file_is_empty (priv->gettext_po_file))
Modified: trunk/src/translation-memory/berkeley/berkeley.c
==============================================================================
--- trunk/src/translation-memory/berkeley/berkeley.c (original)
+++ trunk/src/translation-memory/berkeley/berkeley.c Mon Sep 22 09:46:47 2008
@@ -115,6 +115,7 @@
if (strcmp (array_word, translation_collate) == 0)
{
found = TRUE;
+ g_free (array_word);
break;
}
@@ -506,11 +507,12 @@
{
while (i < array->len -1 && i < ber->priv->max_items)
{
- g_hash_table_insert (hash, g_ptr_array_index (array, i),
+ g_hash_table_insert (hash, g_strdup (g_ptr_array_index (array, i)),
GINT_TO_POINTER (100));
i++;
}
+ g_ptr_array_free (array, TRUE);
goto list;
}
Modified: trunk/src/translation-memory/translation-memory-ui.c
==============================================================================
--- trunk/src/translation-memory/translation-memory-ui.c (original)
+++ trunk/src/translation-memory/translation-memory-ui.c Mon Sep 22 09:46:47 2008
@@ -176,6 +176,7 @@
g_object_set (renderers_list->data,
"accel-mods", GDK_CONTROL_MASK,
NULL);
+ g_list_free (renderers_list);
gtk_list_store_append (model, &iter);
gtk_list_store_set (model,
@@ -262,6 +263,8 @@
g_object_set (renderers_list->data,
"wrap-width", size-10,
NULL);
+
+ g_list_free (renderers_list);
}
Modified: trunk/src/utils.c
==============================================================================
--- trunk/src/utils.c (original)
+++ trunk/src/utils.c Mon Sep 22 09:46:47 2008
@@ -69,6 +69,7 @@
if (strcmp (lower_collate, badwords[i]) == 0)
{
check = FALSE;
+ g_free (lower_collate);
break;
}
i++;
@@ -101,7 +102,7 @@
gint words_size = g_strv_length ((gchar **)badwords);
gint x = 0;
- badwords_collate = g_new0 (gchar *, words_size);
+ badwords_collate = g_new0 (gchar *, words_size + 1);
while (badwords[x] != NULL)
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]