www.gusucode.com > mbcguitools 工具箱 matlab 源码程序 > mbcguitools/@mbcwidgets/@javacomponent/pObjectBeingDestroyed.m

    function pObjectBeingDestroyed(obj, event)
%POBJECTBEINGDESTROYED Called when the view is being destroyed
%
%  POBJECTBEINGDESTROYED(OBJ, EVENT)

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


obj.Peer.destroy;
if ~isempty(obj.hPanel) && ~mbcgui.util.isBeingDestroyed(obj.Parent)
    delete(obj.hPanel);
end
obj.hPanel = [];