[Xfce4-commits] <thunar:master> Fix memory leak caused by not destroying the rename job.
Jannis Pohlmann
noreply at xfce.org
Sun Jan 30 18:30:02 CET 2011
Updating branch refs/heads/master
to e5d3231c6ca5b52cdf6d1f89d8c0d45d5b4f69cf (commit)
from 4eeef3ead20203f33eb6a96519f4f118f592c539 (commit)
commit e5d3231c6ca5b52cdf6d1f89d8c0d45d5b4f69cf
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 1accf91..e3625da 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