function B = validatehandles(B)
%VALIDATEHANDLES  prune invalid scribehandle items from a list

%   Copyright (c) 1984-98 by The MathWorks, Inc.
%   $Revision: 1.2 $  $Date: 1998/07/09 21:32:55 $

if ~isempty(B)
   HGHandles = B.HGHandle;
   if iscell(HGHandles)
      HGHandles = [HGHandles{:}];
   end
   B = B(find(ishandle(HGHandles)));            
end
