[chronojump] CairoGraphRaceAnalyzer ensures Dispose at end



commit baa065ea713a1526f11ddb11b7803cd2228c356e
Author: Xavier de Blas <xaviblas gmail com>
Date:   Tue Mar 15 16:33:35 2022 +0100

    CairoGraphRaceAnalyzer ensures Dispose at end

 src/gui/cairo/raceAnalyzer.cs | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)
---
diff --git a/src/gui/cairo/raceAnalyzer.cs b/src/gui/cairo/raceAnalyzer.cs
index d7ea38ace..b1458c595 100644
--- a/src/gui/cairo/raceAnalyzer.cs
+++ b/src/gui/cairo/raceAnalyzer.cs
@@ -73,11 +73,16 @@ public class CairoGraphRaceAnalyzer : CairoXY
                points_list_painted = 0;
        }
 
+       //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)
        {
-               LogB.Information("at RaceAnalyzerGraph.Do");
+               doSendingList (font, points_list, triggerList, forceRedraw, plotType);
 
-               bool initGraphDone = false;
+               endGraphDisposing(g, surface, area.GdkWindow);
+       }
+
+       private void doSendingList (string font, List<PointF> points_list, TriggerList triggerList, bool 
forceRedraw, PlotTypes plotType)
+       {
                bool maxValuesChanged = false;
                if(points_list != null)
                        maxValuesChanged = findPointMaximums(false, points_list);
@@ -195,9 +200,6 @@ public class CairoGraphRaceAnalyzer : CairoXY
                        foreach(Trigger trigger in triggerList.GetList())
                                paintVerticalTriggerLine(g, trigger, textHeight -3);
 
-               if(initGraphDone)
-                       endGraphDisposing(g, surface, area.GdkWindow);
-
                //doing = false;
        }
 


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