# HG changeset patch # User Rik # Date 1351622119 25200 # Node ID 3649a6012eaac53dfdee5f30343d8582cc8c59a3 # Parent 6a4e791108578b94de6c5c77f11c34f260b8591f 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. diff -r 6a4e79110857 -r 3649a6012eaa scripts/plot/legend.m --- 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");