changeset 15569:3649a6012eaa stable

legend.m: Fix segmentation fault when deleting legend where plot has already been removed (Bug #37640) * legend.m: Use ishandle to check that plot is still valid before removing listeners on it.
author Rik <rik@octave.org>
date Tue, 30 Oct 2012 11:35:19 -0700
parents 6a4e79110857
children cf191298a287 63d024333bee
files scripts/plot/legend.m
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/plot/legend.m	Fri Oct 19 08:46:06 2012 -0700
+++ b/scripts/plot/legend.m	Tue Oct 30 11:35:19 2012 -0700
@@ -886,7 +886,7 @@
   set (t1, "deletefcn", "");
   delete (t1);
   for i = 1 : numel (hplots)
-    if (strcmp (get (hplots (i), "type"), "line"))
+    if (ishandle (hplots(i)) && strcmp (get (hplots (i), "type"), "line"))
       dellistener (hplots (i), "color");
       dellistener (hplots (i), "linestyle");
       dellistener (hplots (i), "marker");