[anjuta] Fix #586621 – Crash while loading project file



commit c34961246e8974e04c8aa46e66406a3c29fbe6ce
Author: Sébastien Granjoux <seb sfo free fr>
Date:   Mon Jun 22 19:59:40 2009 +0200

    Fix #586621 â?? Crash while loading project file

 plugins/run-program/plugin.c |   15 ++++++++-------
 1 files changed, 8 insertions(+), 7 deletions(-)
---
diff --git a/plugins/run-program/plugin.c b/plugins/run-program/plugin.c
index fa36231..2dffb24 100644
--- a/plugins/run-program/plugin.c
+++ b/plugins/run-program/plugin.c
@@ -162,15 +162,16 @@ static void on_session_load (AnjutaShell *shell, AnjutaSessionPhase phase, Anjut
 	if (self->recent_dirs == NULL)
 	{
 		/* Use project directory by default */
-		gchar *project_root_uri;
-		
-		anjuta_shell_get (ANJUTA_PLUGIN(self)->shell,
+		GValue value = {0,};
+	
+		anjuta_shell_get_value (ANJUTA_PLUGIN(self)->shell,
 		    IANJUTA_PROJECT_MANAGER_PROJECT_ROOT_URI,
-		    G_TYPE_STRING,
-		    &project_root_uri,
+		    &value,
 		    NULL);
-
-		self->recent_dirs = g_list_append (NULL, project_root_uri);
+		if (G_VALUE_HOLDS_STRING (&value))
+		{
+			self->recent_dirs = g_list_append (NULL, g_value_dup_string (&value));
+		}
 	}
 
 	g_strfreev (self->environment_vars);



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