[genius] Thu Oct 02 15:09:30 2014 Jiri (George) Lebl <jirka 5z com>



commit f51e10d597be75186977668cdb41c4b0973afe2a
Author: Jiri (George) Lebl <jiri lebl gmail com>
Date:   Thu Oct 2 15:09:33 2014 -0500

    Thu Oct 02 15:09:30 2014  Jiri (George) Lebl <jirka 5z com>
    
        * src/calc.c: fix minor memory leak
    
        * gtkextra/gtkplotcanvasplot.c: fix use after free error
    
        * src/graphing.c: properly show/hide the legends in the "moveabout"
          and therefore it always properly does the right thing even without
          LinePlotClear before LinePlotDrawLine or Points

 ChangeLog                    |   10 ++++++++++
 gtkextra/gtkplotcanvasplot.c |    6 ++++--
 src/calc.c                   |    1 +
 src/graphing.c               |   15 +++++----------
 4 files changed, 20 insertions(+), 12 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index c0b641d..b47d788 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+Thu Oct 02 15:09:30 2014  Jiri (George) Lebl <jirka 5z com>
+
+       * src/calc.c: fix minor memory leak
+
+       * gtkextra/gtkplotcanvasplot.c: fix use after free error
+
+       * src/graphing.c: properly show/hide the legends in the "moveabout"
+         and therefore it always properly does the right thing even without
+         LinePlotClear before LinePlotDrawLine or Points
+
 Tue Sep 30 17:02:54 2014  Jiri (George) Lebl <jirka 5z com>
 
        * pixmaps/*: add svg, 22x22, 24x24, 256x256 versions, and improve the
diff --git a/gtkextra/gtkplotcanvasplot.c b/gtkextra/gtkplotcanvasplot.c
index 92b9cf1..f4ee8ad 100644
--- a/gtkextra/gtkplotcanvasplot.c
+++ b/gtkextra/gtkplotcanvasplot.c
@@ -146,8 +146,10 @@ static void
 gtk_plot_canvas_plot_destroy(GtkObject *object)
 {
   GtkWidget *widget = GTK_WIDGET(GTK_PLOT_CANVAS_PLOT(object)->plot);
-  g_object_unref(widget);
-  widget->parent = NULL;
+  if (widget != NULL) {
+         widget->parent = NULL;
+         g_object_unref(widget);
+  }
 }
 
 static void 
diff --git a/src/calc.c b/src/calc.c
index d2f6d7b..2846f9b 100644
--- a/src/calc.c
+++ b/src/calc.c
@@ -2381,6 +2381,7 @@ load_compiled_fp (const char *file, FILE *fp)
                                g_slist_free(li);
                                goto continue_reading;
                        }
+                       g_free (b2);
                        b2 = g_strdup (at->uncompiled);
                }
 
diff --git a/src/graphing.c b/src/graphing.c
index 81db50c..615cdf0 100644
--- a/src/graphing.c
+++ b/src/graphing.c
@@ -1744,6 +1744,11 @@ line_plot_move_about (void)
                                 1.0-2*PROPORTION_OFFSETY);
                gtk_plot_legends_move (GTK_PLOT (line_plot), 0.80, 0.05);
        }
+
+       if (lineplot_draw_legends)
+               gtk_plot_show_legends (GTK_PLOT (line_plot));
+       else
+               gtk_plot_hide_legends (GTK_PLOT (line_plot));
 }
 
 static void
@@ -4963,11 +4968,6 @@ plot_functions (gboolean do_window_present,
 
        replot_fields ();
 
-       if (lineplot_draw_legends)
-               gtk_plot_show_legends (GTK_PLOT (line_plot));
-       else
-               gtk_plot_hide_legends (GTK_PLOT (line_plot));
-
        line_plot_move_about ();
 
        /* could be whacked by closing the window or some such */
@@ -10544,11 +10544,6 @@ set_LinePlotDrawLegends (GelETree * a)
                lineplot_draw_legends = a->bool_.bool_;
 
        if (line_plot != NULL) {
-               if (lineplot_draw_legends)
-                       gtk_plot_show_legends (GTK_PLOT (line_plot));
-               else
-                       gtk_plot_hide_legends (GTK_PLOT (line_plot));
-
                line_plot_move_about ();
 
                if (plot_canvas != NULL) {


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