[anjuta] bgo #608396 - crash while refreshing a buffer with some breakpoints



commit 3bb8a7d993a31fb88a683bae80c9544f9c0fc98f
Author: Sébastien Granjoux <seb sfo free fr>
Date:   Sun Jan 31 22:52:39 2010 +0100

    bgo #608396 -  crash while refreshing a buffer with some breakpoints

 plugins/debug-manager/breakpoints.c |   15 +++++++++++----
 1 files changed, 11 insertions(+), 4 deletions(-)
---
diff --git a/plugins/debug-manager/breakpoints.c b/plugins/debug-manager/breakpoints.c
index 8b4aa44..3203df6 100644
--- a/plugins/debug-manager/breakpoints.c
+++ b/plugins/debug-manager/breakpoints.c
@@ -358,10 +358,17 @@ breakpoints_dbase_set_in_editor (BreakpointsDBase *bd, BreakpointItem *bi)
 	if (bi->handle != -1)
 	{
 		line = ianjuta_markable_location_from_handle (ed, bi->handle, NULL);
-
-		/* Remove old mark */
-		ianjuta_markable_unmark (ed, line, BREAKPOINT_ENABLED, NULL);
-		ianjuta_markable_unmark (ed, line, BREAKPOINT_DISABLED,NULL);
+		if (line != 0)
+		{
+			/* Remove old mark */
+			ianjuta_markable_unmark (ed, line, BREAKPOINT_ENABLED, NULL);
+			ianjuta_markable_unmark (ed, line, BREAKPOINT_DISABLED,NULL);
+		}
+		else
+		{
+			/* Mark is already removed, perhaps the file has been reloaded */
+			line = bi->bp.line;
+		}
 	}
 	else
 	{



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