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

    function OK = deleteproject(p)
%DELETEPROJECT Fast project deletion for Cage
%
%  DELETEPROJECT(PROJ) deletes the Cage project PROJ.  This method turns on
%  the "beingdeleted" flag in the project which shortcuts most of the
%  deletion checking that occurs in the children.  this method then takes
%  care of freeing all of the pointers itself.

%  Copyright 2000-2015 The MathWorks, Inc. and Ford Global Technologies, Inc.


OK = true;
% remove from list of table providers
mbcutils.GenericTableProvider.Instance.removeTableProvider(cgtools.CageTableProvider(address(p)));
% get list of all pointers
ptrs= saveptrs(p);
% assign [] to all locations before freeing so we don't call freeptr on all
% items
passign(ptrs,[],true);
% free heap
freeptr(ptrs);