[chronojump] Fixed crash since recent commits on cairo graph with area.GdkWindow == null on start



commit 080707d073a33b743b74db0db82fd02d8cb57d02
Author: Xavier de Blas <xaviblas gmail com>
Date:   Mon Aug 23 16:35:55 2021 +0200

    Fixed crash since recent commits on cairo graph with area.GdkWindow == null on start

 src/gui/cairo/bars.cs   | 2 +-
 src/gui/eventExecute.cs | 8 ++++++--
 2 files changed, 7 insertions(+), 3 deletions(-)
---
diff --git a/src/gui/cairo/bars.cs b/src/gui/cairo/bars.cs
index eb28e3442..7b18f7aa0 100644
--- a/src/gui/cairo/bars.cs
+++ b/src/gui/cairo/bars.cs
@@ -342,7 +342,7 @@ public class CairoBarsJustTesting : CairoBars
        {
                this.area = area;
 
-               LogB.Information("area is null:" + (area == null).ToString());
+               LogB.Information("constructor without points, area is null:" + (area == null).ToString());
                initGraph(font, 1); //.8 to have title at right
 
                endGraphDisposing(g);
diff --git a/src/gui/eventExecute.cs b/src/gui/eventExecute.cs
index 3e6a71d78..eed0be2bd 100644
--- a/src/gui/eventExecute.cs
+++ b/src/gui/eventExecute.cs
@@ -1131,7 +1131,9 @@ public partial class ChronoJumpWindow
 
        private void paintJumpSimpleCairoTest()
        {
-               if(eventGraphJumpsCairoStored == null || event_execute_drawingarea_cairo == null)
+               if(eventGraphJumpsCairoStored == null ||
+                               event_execute_drawingarea_cairo == null ||
+                               event_execute_drawingarea_cairo.GdkWindow == null) //at start program, this 
can fail
                        return;
 
                if(eventGraphJumpsCairoStored.jumpsAtSQL.Count == 0)
@@ -1757,7 +1759,9 @@ public partial class ChronoJumpWindow
 
        private void paintRunSimpleCairoTest()
        {
-               if(eventGraphRunsCairoStored == null || event_execute_drawingarea_cairo == null)
+               if(eventGraphRunsCairoStored == null ||
+                               event_execute_drawingarea_cairo == null ||
+                               event_execute_drawingarea_cairo.GdkWindow == null) //at start program, this 
can fail
                        return;
 
                if(eventGraphRunsCairoStored.runsAtSQL.Count == 0)


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