Mercurial > hg > octave-lyh
diff scripts/plot/legend.m @ 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 | 72c96de7a403 |
children | cf191298a287 |
line wrap: on
line diff
--- a/scripts/plot/legend.m +++ b/scripts/plot/legend.m @@ -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");