[chronojump] CairoGraphRaceAnalyzer ensures Dispose at end (2)



commit d905e66407b25803e28c8d8fd27904a4ad84e252
Author: Xavier de Blas <xaviblas gmail com>
Date:   Tue Mar 15 16:40:40 2022 +0100

    CairoGraphRaceAnalyzer ensures Dispose at end (2)

 src/gui/cairo/raceAnalyzer.cs | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)
---
diff --git a/src/gui/cairo/raceAnalyzer.cs b/src/gui/cairo/raceAnalyzer.cs
index 710f9113d..3ff1a369b 100644
--- a/src/gui/cairo/raceAnalyzer.cs
+++ b/src/gui/cairo/raceAnalyzer.cs
@@ -76,12 +76,12 @@ public class CairoGraphRaceAnalyzer : CairoXY
        //separated in two methods to ensure endGraphDisposing on any return of the other method
        public override void DoSendingList (string font, List<PointF> points_list, TriggerList triggerList, 
bool forceRedraw, PlotTypes plotType)
        {
-               doSendingList (font, points_list, triggerList, forceRedraw, plotType);
-
-               endGraphDisposing(g, surface, area.GdkWindow);
+               if(doSendingList (font, points_list, triggerList, forceRedraw, plotType))
+                       endGraphDisposing(g, surface, area.GdkWindow);
        }
 
-       private void doSendingList (string font, List<PointF> points_list, TriggerList triggerList, bool 
forceRedraw, PlotTypes plotType)
+       //return true if graph is inited (to dispose it)
+       private bool doSendingList (string font, List<PointF> points_list, TriggerList triggerList, bool 
forceRedraw, PlotTypes plotType)
        {
                bool maxValuesChanged = false;
                if(points_list != null)
@@ -95,7 +95,7 @@ public class CairoGraphRaceAnalyzer : CairoXY
                if(points_list == null || points_list.Count == 0)
                {
                        paintAxis();
-                       return;
+                       return true;
                }
 
                if(maxValuesChanged || forceRedraw)
@@ -205,6 +205,7 @@ public class CairoGraphRaceAnalyzer : CairoXY
                                paintVerticalTriggerLine(g, trigger, textHeight -3);
 
                //doing = false;
+               return true;
        }
 
        protected override void printYAxisText()


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