aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog12
-rw-r--r--embed/downloader-view.c36
-rw-r--r--lib/widgets/ephy-tree-model-sort.c13
-rw-r--r--src/language-editor.c7
4 files changed, 54 insertions, 14 deletions
diff --git a/ChangeLog b/ChangeLog
index 7fe6ef31d..a5d72b88c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,17 @@
2003-07-13 Christian Persch <chpe@cvs.gnome.org>
+ * src/language-editor.c: (language_editor_remove_button_clicked_cb):
+ * embed/downloader-view.c: (downloader_view_set_download_info),
+ (downloader_view_remove_download),
+ (downloader_view_set_download_progress),
+ (downloader_view_set_download_status), (download_dialog_abort_cb):
+ * lib/widgets/ephy-tree-model-sort.c:
+ (ephy_tree_model_sort_multi_row_draggable):
+
+ Fix mem leaks.
+
+2003-07-13 Christian Persch <chpe@cvs.gnome.org>
+
* lib/ephy-node.c: (ephy_node_finalize):
Fix mem leaks.
diff --git a/embed/downloader-view.c b/embed/downloader-view.c
index 6a1177c09..2fab5601a 100644
--- a/embed/downloader-view.c
+++ b/embed/downloader-view.c
@@ -459,7 +459,7 @@ downloader_view_set_download_info (DownloaderViewPrivate *priv,
GtkTreeIter *iter)
{
gchar buffer[50];
- GtkTreePath *path;
+ GtkTreePath *path = NULL;
GtkTreePath *selected_path = NULL;
GtkTreeIter selected_iter;
GtkTreeSelection *selection;
@@ -550,6 +550,9 @@ downloader_view_set_download_info (DownloaderViewPrivate *priv,
{
downloader_view_update_details (priv, details);
}
+
+ gtk_tree_path_free (path);
+ gtk_tree_path_free (selected_path);
}
static void
@@ -630,15 +633,17 @@ downloader_view_remove_download (DownloaderView *dv,
gpointer persist_object)
{
DownloadDetails *details;
+ GtkTreePath *path = NULL;
GtkTreeIter iter;
details = g_hash_table_lookup (dv->priv->details_hash,
persist_object);
g_return_if_fail (details);
+ path = gtk_tree_row_reference_get_path (details->ref);
+
gtk_tree_model_get_iter (GTK_TREE_MODEL (dv->priv->model),
- &iter,
- gtk_tree_row_reference_get_path (details->ref));
+ &iter, path);
gtk_list_store_remove (GTK_LIST_STORE (dv->priv->model), &iter);
@@ -646,6 +651,8 @@ downloader_view_remove_download (DownloaderView *dv,
persist_object);
ensure_selected_row (dv);
+
+ gtk_tree_path_free (path);
}
void
@@ -659,6 +666,7 @@ downloader_view_set_download_progress (DownloaderView *dv,
gpointer persist_object)
{
DownloadDetails *details;
+ GtkTreePath *path = NULL;
GtkTreeIter iter;
details = g_hash_table_lookup (dv->priv->details_hash,
@@ -672,11 +680,14 @@ downloader_view_set_download_progress (DownloaderView *dv,
details->size_done = size_done;
details->progress = progress;
+ path = gtk_tree_row_reference_get_path (details->ref);
+
gtk_tree_model_get_iter (GTK_TREE_MODEL (dv->priv->model),
- &iter,
- gtk_tree_row_reference_get_path (details->ref));
+ &iter, path);
downloader_view_set_download_info (dv->priv, details, &iter);
+
+ gtk_tree_path_free (path);
}
void
@@ -685,6 +696,7 @@ downloader_view_set_download_status (DownloaderView *dv,
gpointer persist_object)
{
DownloadDetails *details;
+ GtkTreePath *path = NULL;
GtkTreeIter iter;
details = g_hash_table_lookup (dv->priv->details_hash,
@@ -693,9 +705,10 @@ downloader_view_set_download_status (DownloaderView *dv,
details->status = status;
+ path = gtk_tree_row_reference_get_path (details->ref);
+
gtk_tree_model_get_iter (GTK_TREE_MODEL (dv->priv->model),
- &iter,
- gtk_tree_row_reference_get_path (details->ref));
+ &iter, path);
downloader_view_set_download_info (dv->priv, details, &iter);
downloader_view_update_controls (dv->priv);
@@ -704,6 +717,8 @@ downloader_view_set_download_status (DownloaderView *dv,
{
downloader_view_remove_download (dv, persist_object);
}*/
+
+ gtk_tree_path_free (path);
}
static void
@@ -872,13 +887,15 @@ download_dialog_abort_cb (GtkButton *button, DownloaderView *dv)
for (r = rlist; r != NULL; r = r->next)
{
GtkTreeRowReference *node = r->data;
+ GtkTreePath *path = NULL;
GValue val = {0, };
gpointer *persist_object;
GtkTreeIter iter;
DownloadDetails *details;
- gtk_tree_model_get_iter (model, &iter,
- gtk_tree_row_reference_get_path (node));
+ path = gtk_tree_row_reference_get_path (node);
+
+ gtk_tree_model_get_iter (model, &iter, path);
gtk_tree_model_get_value (model, &iter,
COL_PERSIST_OBJECT, &val);
@@ -893,6 +910,7 @@ download_dialog_abort_cb (GtkButton *button, DownloaderView *dv)
downloader_view_remove_download (dv, persist_object);
gtk_tree_row_reference_free (node);
+ gtk_tree_path_free (path);
}
g_list_foreach (llist, (GFunc)gtk_tree_path_free, NULL);
diff --git a/lib/widgets/ephy-tree-model-sort.c b/lib/widgets/ephy-tree-model-sort.c
index b91946e8d..d3b425325 100644
--- a/lib/widgets/ephy-tree-model-sort.c
+++ b/lib/widgets/ephy-tree-model-sort.c
@@ -180,6 +180,8 @@ ephy_tree_model_sort_multi_row_draggable (EggTreeMultiDragSource *drag_source, G
ephy_tree_model_sort_signals[NODE_FROM_ITER],
0, &iter, &node);
+ gtk_tree_path_free (path);
+
if (node == NULL)
{
return FALSE;
@@ -215,15 +217,19 @@ each_url_get_data_binder (EphyDragEachSelectedItemDataGet iteratee,
for (i = path_list; i != NULL; i = i->next)
{
GtkTreeIter iter;
- GtkTreePath *path = gtk_tree_row_reference_get_path (i->data);
+ GtkTreePath *path = NULL;
EphyNode *node = NULL;
const char *value;
+ path = gtk_tree_row_reference_get_path (i->data);
+
gtk_tree_model_get_iter (GTK_TREE_MODEL (model), &iter, path);
g_signal_emit (G_OBJECT (model),
ephy_tree_model_sort_signals[NODE_FROM_ITER],
0, &iter, &node);
+ gtk_tree_path_free (path);
+
if (node == NULL)
return;
@@ -248,15 +254,18 @@ each_node_get_data_binder (EphyDragEachSelectedItemDataGet iteratee,
for (i = path_list; i != NULL; i = i->next)
{
GtkTreeIter iter;
- GtkTreePath *path = gtk_tree_row_reference_get_path (i->data);
+ GtkTreePath *path = NULL;
EphyNode *node = NULL;
EphyNodeDb *db;
char *value;
+ path = gtk_tree_row_reference_get_path (i->data);
gtk_tree_model_get_iter (GTK_TREE_MODEL (model), &iter, path);
g_signal_emit (G_OBJECT (model),
ephy_tree_model_sort_signals[NODE_FROM_ITER],
0, &iter, &node);
+ gtk_tree_path_free (path);
+
if (node == NULL)
return;
diff --git a/src/language-editor.c b/src/language-editor.c
index 893693353..84c19ec2e 100644
--- a/src/language-editor.c
+++ b/src/language-editor.c
@@ -212,16 +212,17 @@ language_editor_remove_button_clicked_cb (GtkButton *button,
for (r = rlist; r != NULL; r = r->next)
{
- GtkTreePath *node;
+ GtkTreePath *path;
- node = gtk_tree_row_reference_get_path
+ path = gtk_tree_row_reference_get_path
((GtkTreeRowReference *)r->data);
- gtk_tree_model_get_iter (model, &iter, node);
+ gtk_tree_model_get_iter (model, &iter, path);
gtk_list_store_remove (GTK_LIST_STORE (model), &iter);
gtk_tree_row_reference_free ((GtkTreeRowReference *)r->data);
+ gtk_tree_path_free (path);
}
g_list_foreach (llist, (GFunc)gtk_tree_path_free, NULL);