In the plugin, I have allocated a "- (void) dealloc" method within the @implementation for the QCPlugin. It's supposed to clean up for the hardware and deallocate any buffers etc. that were allocated in the "- (id) init" method of @implementation for the QCPlugin.
This is a very bad idea -- don't expect init or dealloc to be your friend in QC (in the QC editor, the undo manager will often hold on to your patch for dear life long after it's gone, leading to this problem you're experiencing -- trust me on this one.)
And doing the dispose in the "- (void) stopExecution: (id<QCPlugInContext>)context" method of the QCPlugin does not make sense when using external hardware. If there are multiple hardware devices and multiple plugins, it should be one plugin per device and the plugin should exclusively access the hardware for the duration of it's existence.
Using "duration of it's existence" is kinda bad -- a composition (with associated patches) can hang around in memory long before it's ever actually expected to render. Holding devices for that long isn't a good design. An application can also have multiple instances of the composition in memory, while never actually using them simultaneously -- if the plugin exclusively locks hardware when it's allocated, the second (and subsequent) instances will be locked out incorrectly.
If there are multiple devices (Dev A, B and C), and multiple patches (Using-A, Using-B, and Using-C), there's nothing wrong with them cleaning up as they fall out of use. If the underlying devices are in fact shared (2 Using-A patches, for example), you should use a singleton usage manager to properly open/close the device when necessary (open only on first request, close only when all users have finished). We've used this design pattern for a few shared resource plugins successfully.
-- [ christopher wright ] [email protected] http://kineme.net/
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________ Do not post admin requests to the list. They will be ignored. Quartzcomposer-dev mailing list ([email protected]) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/quartzcomposer-dev/archive%40mail-archive.com This email sent to [email protected]

