Le 02/11/2010 19:11, Nick Treleaven a écrit :
> Hi list,
> To workaround bug(s) in GVFS, I've now changed the file saving
> implementation for systems with GIO in SVN trunk. See also:
> 
> http://lists.uvena.de/geany-devel/2010-November/003412.html
> 
> Please help test this. File permissions should be preserved after
> saving, and disk space exhaustion should now be handled without losing
> the previously saved file.
Interesting change, let's see what happens now -- this said I don't use
remote files often so I will probably not notice any change...

Just to mention (I just saw that the question raised in the original
thread, sorry not to have seen it before): you actually need to release
GFiles with g_object_unref(). I'd thought it would be quite obvious --
you create an object, you destroy it -- but seems not :)
So, here's a (very) small patch for this.

Best regards,
Colomban
>From f7104de631c144c5c8f9fde7e5f6acf8bc04faec Mon Sep 17 00:00:00 2001
From: Colomban Wendling <b...@herbesfolles.org>
Date: Tue, 2 Nov 2010 23:54:00 +0100
Subject: [PATCH] Don't leak a GFile around upon file saving when built with GIO support

---
 src/document.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/src/document.c b/src/document.c
index c261c68..5616959 100644
--- a/src/document.c
+++ b/src/document.c
@@ -1719,6 +1719,7 @@ static gchar *write_data_to_disk(const gchar *locale_filename,
 	fp = g_file_new_for_path(locale_filename);
 	g_file_replace_contents(fp, data, len, NULL, FALSE,
 		G_FILE_CREATE_NONE, NULL, NULL, &error);
+	g_object_unref(fp);
 #else
 	gint err = 0;
 	FILE *fp;
-- 
1.7.2.3

_______________________________________________
Geany-devel mailing list
Geany-devel@uvena.de
http://lists.uvena.de/cgi-bin/mailman/listinfo/geany-devel

Reply via email to