Diff of /blockproc/blockdone.m [e5fffd] .. [7c7a96]  Maximize  Restore

Switch to side-by-side view

--- a/blockproc/blockdone.m
+++ b/blockproc/blockdone.m
@@ -1,12 +1,29 @@
-function blockdone()
-%BLOCKDONE  Destroy the block object
-%   Usage: blockdone(B);
+function blockdone(varargin)
+%BLOCKDONE  Destroy the current blockstream
+%   Usage: blockdone();
-%   `blockdone()` closes the current block interface.
+%   `blockdone()` closes the current blockstream. The function resets
+%   the playrec tool and clear all buffers in block_interface.
+%   `blockdone(p1,p2,...)` in addition tries to call close methods on
+%   all input arguments which are JAVA objects (which are passed by reference).
 %   See also: block
 % TO DO: Process additional zeros to compensate for the delay 
+for ii=1:numel(varargin)
+   p = varargin{ii};
+   if isjava(p)
+      try
+         javaMethod('close',p);
+      catch
+         warning(sprintf('%s: Object %i does not have a close method.',upper(mfilename),ii));
+      end
+   elseif isstruct(p) && isfield(p,'destructor') && isa(p.destructor,'function_handle')
+      p.destructor();
+   end

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.

No, thanks