aboutsummaryrefslogtreecommitdiffstats
path: root/embed
diff options
context:
space:
mode:
authorChristian Persch <chpe@cvs.gnome.org>2003-07-14 01:03:14 +0800
committerChristian Persch <chpe@src.gnome.org>2003-07-14 01:03:14 +0800
commit4bf4f76bffb2f7eb18672d26aace9c097b439fb9 (patch)
treee2b1326d8aab6316cebdf715fa959f56c81f3be6 /embed
parent8251e7c1e69a39cc178a288aba7a006a9449cc00 (diff)
downloadgsoc2013-epiphany-4bf4f76bffb2f7eb18672d26aace9c097b439fb9.tar.gz
gsoc2013-epiphany-4bf4f76bffb2f7eb18672d26aace9c097b439fb9.tar.zst
gsoc2013-epiphany-4bf4f76bffb2f7eb18672d26aace9c097b439fb9.zip
Fix mem leaks.
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.
Diffstat (limited to 'embed')
-rw-r--r--embed/downloader-view.c36
1 files changed, 27 insertions, 9 deletions
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);