This is a static copy of a profile report

Home

close>request_close_helper (34 calls, 0.000 sec)
Generated 05-Aug-2011 13:01:35 using cpu time.
subfunction in file /usr/local/MATLAB/R2011a/toolbox/matlab/graphics/close.m
Copy to new window for comparing multiple runs

Parents (calling functions)

Function NameFunction TypeCalls
close>request_closesubfunction34
Lines where the most time was spent
No measurable time spent in this function

Line NumberCodeCallsTotal Time% TimeTime Plot
148
status = true;
170 s0%
147
closeVisitedHandles(closeVisit...
170 s0%
146
old_shh(end) = [];
170 s0%
145
set(0,'ShowHiddenHandles', old...
170 s0%
142
case 'post'
170 s0%
All other lines  0 s0%
Totals  0 s0% 
Children (called functions)

Function NameFunction TypeCallsTotal Time% TimeTime Plot
close>checkfigssubfunction170 s0%
ismemberfunction170 s0%
Self time (built-ins, overhead, etc.)  0 s0%
Totals  0 s0% 
Code Analyzer results
No Code Analyzer messages.
Coverage results
[ Show coverage for parent directory ]
Total lines in function44
Non-code lines (comments, blank lines)18
Code lines (lines that can run)26
Code lines that did run16
Code lines that did not run10
Coverage (did run/can run)61.54 %
Function listing
   time   calls  line
108 function status = request_close_helper(h,pre_or_post)
109 % When called with a valid figure handle and the flag 'pre', this stores
110 % current figure and current state of hidden handles in persistent variables
111 % for easy restoration.
112 % When called with any 1st input and the flag 'post', this restores
113 % current figure and the state of hidden handles.
114 % If called with the flag 'pre' twice without an intervening call with flag
115 % 'post', a warning is thrown, the passed in handle is deleted, and status
116 % returned is false.
117
34 118 persistent closeVisitedHandles;
34 119 persistent old_shh;
120
34 121 switch pre_or_post
34 122 case 'pre'
123 % prevent recursion
17 124 if ismember(h, closeVisitedHandles)
125 % Throw the warning. Allow users to turn off the warning using the ID.
126 warning('MATLAB:Figure:RecursionOnClose', ...
127 'A callback recursively calls CLOSE. Use DELETE to prevent this message.');
128 delete(h)
129 status = false;
130 return;
131 end
132
17 133 if ~checkfigs(h)
134 error('MATLAB:close:assert','Unexpected invalid handle passed to request_close_helper')
135 end
136
17 137 old_shh{end+1} = get(0,'ShowHiddenHandles');
17 138 set(0,'ShowHiddenHandles', 'on')
17 139 set(0,'CurrentFigure', h)
17 140 closeVisitedHandles = [closeVisitedHandles, h];
17 141 status = true;
17 142 case 'post'
143 % we don't want to restore gcf here as the CloseRequestFcn
144 % may have changed it on purpose
17 145 set(0,'ShowHiddenHandles', old_shh{end})
17 146 old_shh(end) = [];
17 147 closeVisitedHandles(closeVisitedHandles==h) = [];
17 148 status = true;
149 otherwise
150 error('MATLAB:close:assert','Unexpected value passed to request_close_helper')
151 end

Other subfunctions in this file are not included in this listing.