Operation to un-manage a resource
There should be an operation to remove resources from the resource manager. It will require the addition of machinery to the operation base class in order to avoid client-server issues and resource locking.
There are several reasons this should be an operation
- Removing a resources should not happen when an operation holds a lock to the resource. While it is likely that any operation would continue without problem (because most operations will hold a shared pointer to the resource in play), it could cause issues with resource::Links and other parts of SMTK.
- Also, resource-manager observers will be invoked immediately when the resource is removed from the resource::Manager. If this happens in the middle of an operation, the GUI thread may attempt to access the resource while it is being edited.
Therefore, to avoid the resource manager observers from being invoked while the operation is running, we propose a new item in the Operation::Result attribute: expungedResources
. When this item has values set, the operation::Operation class will remove the named resources from their resource manager after invoking operation observers but before releasing resource locks. This will ensure that any GUI updates in response to the operation occur before resource-manager observers are invoked.