gnome-main-menu r542 - in trunk: . libslab



Author: sreeves
Date: Sat Jan  3 00:18:50 2009
New Revision: 542
URL: http://svn.gnome.org/viewvc/gnome-main-menu?rev=542&view=rev

Log:
Fix g_object_unref G_IS_OBJECT assertions.

Modified:
   trunk/ChangeLog
   trunk/libslab/directory-tile.c
   trunk/libslab/document-tile.c
   trunk/libslab/gnome-utils.c

Modified: trunk/libslab/directory-tile.c
==============================================================================
--- trunk/libslab/directory-tile.c	(original)
+++ trunk/libslab/directory-tile.c	Sat Jan  3 00:18:50 2009
@@ -304,7 +304,8 @@
 	g_free (priv->icon_name);
 	g_free (priv->mime_type);
 
-	g_object_unref (priv->default_app);
+	if (priv->default_app)
+		g_object_unref (priv->default_app);
     
 	client = gconf_client_get_default ();
 

Modified: trunk/libslab/document-tile.c
==============================================================================
--- trunk/libslab/document-tile.c	(original)
+++ trunk/libslab/document-tile.c	Sat Jan  3 00:18:50 2009
@@ -318,11 +318,14 @@
 	GAppInfo *app;
 
 	GConfClient *client;
+	GError *error = NULL;
 
 	file = g_file_new_for_uri (TILE (this)->uri);
-	app = g_file_query_default_handler (file, NULL, NULL);
+	app = g_file_query_default_handler (file, NULL, &error);
 	priv->default_app = app;
 
+	if (error)
+		g_error_free (error);
 	g_object_unref (file);
 
 	priv->delete_enabled =
@@ -378,7 +381,8 @@
 	g_free (priv->mime_type);
 	g_free (priv->force_icon_name);
 
-	g_object_unref (priv->default_app);
+	if (priv->default_app)
+		g_object_unref (priv->default_app);
 
 	if (priv->notify_signal_id)
 		g_signal_handler_disconnect (priv->agent, priv->notify_signal_id);
@@ -1017,8 +1021,10 @@
 		item->uri       = tile->uri;
 		item->mime_type = priv->mime_type;
 		item->mtime     = priv->modified;
-		item->app_name  = (gchar *) g_app_info_get_name (priv->default_app);
-		item->app_exec  = (gchar *) g_app_info_get_executable (priv->default_app);
+		if (priv->default_app) {
+			item->app_name  = (gchar *) g_app_info_get_name (priv->default_app);
+			item->app_exec  = (gchar *) g_app_info_get_executable (priv->default_app);
+		}
 
 		bookmark_agent_add_item (priv->agent, item);
 		g_free (item);

Modified: trunk/libslab/gnome-utils.c
==============================================================================
--- trunk/libslab/gnome-utils.c	(original)
+++ trunk/libslab/gnome-utils.c	Sat Jan  3 00:18:50 2009
@@ -175,10 +175,11 @@
 		break;
 	}
 
-      exit:
+	exit:
 
 	g_object_unref (client);
-	gconf_value_free (value);
+	if(value)
+		gconf_value_free (value);
 
 	return retval;
 }



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