www.gusucode.com > mbcview 工具箱matlab源码程序 > mbcview/@cgoptimnode/delchild.m

    function obj = delchild(obj, chindex)
%DELCHILD Notify parent of child deletion
%
%  OBJ = DELCHILD(OBJ, CHINDEX) is called when the child at chindex is
%  deleted.

%  Copyright 2005 The MathWorks, Inc.


if chindex<=length(obj.OutputData)
    % Remove and free the reference to output data
    pData = obj.OutputData(chindex);
    obj.OutputData(chindex) = [];
    
    if isvalid(pData)
        freeptr(pData);
    end
    
    % Update heap copy of node
    xregpointer(obj);
end