Hi Matt, calling "clear" inside SPMD is not necessary - that's not the problem. Because of the way Composites work, when they go out of scope the workers don't find out immediately, only on the next SPMD block. If you add an SPMD block to your function, that's not sufficient since that happens before the Composites are created during the WorkerObjWrapper deletion.
Next suggestion: try adding the following line
val = ; dtor = ; valdtor = ;
as the last line inside the SPMD block in workerDelete.
30 Oct 2013
Worker Object Wrapper
Simplifies managing resources such as large data within PARFOR loops and SPMD blocks
Hi Edric. An empty spmd block does clear them, but only from the command line. Putting it at the end of the function that created the wrapper object does no good. I also tried inserting an empty spmd block in the classdef where you recommended. That also didn't affect anything.
Is it desired behavior for an empty spmd block to clear the object? It is particular that sending no command to the workers forces a clear. Wouldn't it be better to enable
spmd, clear obj; end
Why wouldn't spmd