[gthumb] fixed crash when the location is null



commit e048c340b1a6b2b12863fcbbe149b4b802103138
Author: Paolo Bacchilega <paobac src gnome org>
Date:   Sat Aug 13 01:08:56 2011 +0200

    fixed crash when the location is null

 gthumb/gth-browser.c |   15 +++++++++++++--
 1 files changed, 13 insertions(+), 2 deletions(-)
---
diff --git a/gthumb/gth-browser.c b/gthumb/gth-browser.c
index 0bdb248..2396c2f 100644
--- a/gthumb/gth-browser.c
+++ b/gthumb/gth-browser.c
@@ -1045,13 +1045,24 @@ get_free_space_ready_cb (GthFileSource *file_source,
 static void
 _gth_browser_update_statusbar_list_info (GthBrowser *browser)
 {
-	if (browser->priv->recalc_location_free_space)
+	if (browser->priv->recalc_location_free_space
+	    && (browser->priv->location_source != NULL)
+	    && (browser->priv->location != NULL))
+	{
 		gth_file_source_get_free_space (browser->priv->location_source,
 						browser->priv->location->file,
 						get_free_space_ready_cb,
 						browser);
-	else
+	}
+	else {
+		if ((browser->priv->location_source == NULL)
+		    || (browser->priv->location == NULL))
+		{
+			g_free (browser->priv->location_free_space);
+			browser->priv->location_free_space = NULL;
+		}
 		_update_statusbar_list_info (browser);
+	}
 }
 
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]