parents are unaware of their deceased children?

Ben Abbott bpabbott at mac.com
Thu Oct 9 18:29:18 CDT 2008


I was working on a Matlab compatible clf() and encountered this  
problem ...

octave-3.1.51+:1> plot (1:10)

everything is fine here, but ...

octave-3.1.51+:2> delete (get (gcf, "children"))
octave-3.1.51+:3> plot (1:10)
error: axes: expecting argument to be a scalar axes handle
error: called from:
error:   /sw/share/octave/3.1.51+/m/plot/axes.m at line 55, column 7
error: axes: expecting argument to be a scalar axes handle
error: called from:
error:   /sw/share/octave/3.1.51+/m/plot/axes.m at line 55, column 7
error:   /sw/share/octave/3.1.51+/m/plot/plot.m at line 187, column 5

The error results because h=gca() returns the deleted axis handle,  
which results from ...

	h = get (gcf (), "currentaxes");

Apparently the parent is unaware that the child has died ;-)

How should this be handled? I could modify delete.m to prune children  
from their parents, but expect it is preferred to have this done at a  
lower level.

Ben


More information about the Octave-maintainers mailing list