anjuta r3558 - in trunk: . plugins/document-manager



Author: jhs
Date: Thu Jan 31 21:44:03 2008
New Revision: 3558
URL: http://svn.gnome.org/viewvc/anjuta?rev=3558&view=rev

Log:
2008-01-31  Johannes Schmid <jhs gnome org>

	* plugins/document-manager/plugin.c: (on_document_changed):
	Fixed crash when closing anjuta after all document tabs have been closed

Modified:
   trunk/ChangeLog
   trunk/plugins/document-manager/plugin.c

Modified: trunk/plugins/document-manager/plugin.c
==============================================================================
--- trunk/plugins/document-manager/plugin.c	(original)
+++ trunk/plugins/document-manager/plugin.c	Thu Jan 31 21:44:03 2008
@@ -1140,14 +1140,22 @@
 					 AnjutaPlugin *plugin)
 {
 	update_document_ui (plugin, doc);
-
-	GValue value = {0, };
-	g_value_init (&value, G_TYPE_OBJECT);
-	g_value_set_object (&value, doc);
-	anjuta_shell_add_value (plugin->shell,
-							"document_manager_current_editor",
-							&value, NULL);
-	g_value_unset(&value);
+	
+	if (doc)
+	{
+		GValue value = {0, };
+		g_value_init (&value, G_TYPE_OBJECT);
+		g_value_set_object (&value, doc);
+		anjuta_shell_add_value (plugin->shell,
+								"document_manager_current_editor",
+								&value, NULL);
+		g_value_unset(&value);
+	}
+	else
+	{
+		anjuta_shell_remove_value (plugin->shell, "document_manager_current_editor",
+								   NULL);
+	}
 
 	if (doc && IANJUTA_IS_EDITOR (doc))
 	{



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