[Xfce4-commits] <thunar:xfce-4.8> Fix memory leak caused by not destroying the rename job.
Jannis Pohlmann
noreply at xfce.org
Sun Jan 30 18:30:04 CET 2011
Updating branch refs/heads/xfce-4.8
to 402dd4831fabe607c98365b415f117b2f619d3f0 (commit)
from b70c4abab3503eb4d3682e3ff619a2c5336e8247 (commit)
commit 402dd4831fabe607c98365b415f117b2f619d3f0
Author: Jannis Pohlmann <jannis at xfce.org>
Date: Sun Jan 30 18:28:17 2011 +0100
Fix memory leak caused by not destroying the rename job.
NEWS | 1 +
thunar/thunar-application.c | 16 ++++++++++++++++
2 files changed, 17 insertions(+), 0 deletions(-)
diff --git a/NEWS b/NEWS
index 7535d6c..91c8f10 100644
--- a/NEWS
+++ b/NEWS
@@ -8,6 +8,7 @@
- Fix segfault when calling strcasecmp with NULL parameters (bug #7206).
- Only change the Name field when renaming desktop files (bug #7155).
- Force desktop file reload after changing the Name field.
+- Fix memory leak caused by not destroying the rename job.
1.2.0
=====
diff --git a/thunar/thunar-application.c b/thunar/thunar-application.c
index c65d5b2..4490105 100644
--- a/thunar/thunar-application.c
+++ b/thunar/thunar-application.c
@@ -1237,6 +1237,18 @@ thunar_application_rename_file_error (ExoJob *job,
+static void
+thunar_application_rename_file_finished (ExoJob *job,
+ gpointer user_data)
+{
+ _thunar_return_if_fail (EXO_IS_JOB (job));
+
+ /* destroy the job object */
+ g_object_unref (job);
+}
+
+
+
/**
* thunar_application_rename_file:
* @application : a #ThunarApplication.
@@ -1275,6 +1287,10 @@ thunar_application_rename_file (ThunarApplication *application,
/* handle rename errors */
g_signal_connect (job, "error",
G_CALLBACK (thunar_application_rename_file_error), application);
+
+ /* destroy the job when it has finished */
+ g_signal_connect (job, "finished",
+ G_CALLBACK (thunar_application_rename_file_finished), NULL);
}
}
More information about the Xfce4-commits
mailing list