[anjuta/git-shell: 231/234] libanjuta: #615718 - anjuta-command crash call on set_error_message.



commit 6636197de5020339313852e7f1c2bbb05fe5ebee
Author: Johannes Schmid <jhs gnome org>
Date:   Sun Apr 18 22:08:47 2010 +0200

    libanjuta: #615718  - anjuta-command crash call on set_error_message.

 libanjuta/anjuta-command.c |    5 ++---
 libanjuta/anjuta-command.h |    4 ++--
 2 files changed, 4 insertions(+), 5 deletions(-)
---
diff --git a/libanjuta/anjuta-command.c b/libanjuta/anjuta-command.c
index 97da142..6f578d6 100644
--- a/libanjuta/anjuta-command.c
+++ b/libanjuta/anjuta-command.c
@@ -327,10 +327,9 @@ anjuta_command_is_running (AnjutaCommand *self)
  * of failure. 
  */
 void
-anjuta_command_set_error_message (AnjutaCommand *self, gchar *error_message)
+anjuta_command_set_error_message (AnjutaCommand *self, const gchar *error_message)
 {
-	if (self->priv->error_message)
-		g_free (error_message);
+	g_free (self->priv->error_message);
 	
 	self->priv->error_message = g_strdup (error_message);
 }
diff --git a/libanjuta/anjuta-command.h b/libanjuta/anjuta-command.h
index 234758a..b608882 100644
--- a/libanjuta/anjuta-command.h
+++ b/libanjuta/anjuta-command.h
@@ -51,7 +51,7 @@ struct _AnjutaCommandClass
 	void (*notify_data_arrived) (AnjutaCommand *self);
 	void (*notify_complete) (AnjutaCommand *self, guint return_code);
 	void (*notify_progress) (AnjutaCommand *self, gfloat progress);
-	void (*set_error_message) (AnjutaCommand *self, gchar *error_message);
+	void (*set_error_message) (AnjutaCommand *self, const gchar *error_message);
 	gchar * (*get_error_message) (AnjutaCommand *self);
 	gboolean (*start_automatic_monitor) (AnjutaCommand *self);
 	void (*stop_automatic_monitor) (AnjutaCommand *self);
@@ -80,7 +80,7 @@ void anjuta_command_notify_complete (AnjutaCommand *self, guint return_code);
 void anjuta_command_notify_progress (AnjutaCommand *self, gfloat progress);
 gboolean anjuta_command_is_running (AnjutaCommand *self);
 
-void anjuta_command_set_error_message (AnjutaCommand *self, gchar *error_message);
+void anjuta_command_set_error_message (AnjutaCommand *self, const gchar *error_message);
 gchar *anjuta_command_get_error_message (AnjutaCommand *self);
 
 gboolean anjuta_command_start_automatic_monitor (AnjutaCommand *self);



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