IHolder::Close
Closes the holder.
HRESULT IHolder::Close ();
Comments
This closes a resource dispenser's holder, after which the resource dispenser will probably be released.
Before closing, any remaining inventory is destroyed by calling back to the resource dispenser's DestroyResource.
The following sequence describes how to close down a resource dispenser.
-
You must hold a reference to the resource dispenser (the object which exposes IDispenserDriver).
-
Call a method in resource dispenser whose implementation calls IHolder::Close.
-
IHolder::Close destroys any remaining inventory by calling back to resource dispenser's DestroyResource.
-
IHolder::Close calls DispMan to remove this holder from the holder list. (If there are now no holders left, the DispMan object deletes itself.)
-
IHolder::Close releases its reference to resource dispenser's IDispenserDriver. Note that this is the reason you need a reference in step 1; otherwise, the resource dispenser would delete itself prematurely before the subsequent steps can be completed.
-
IHolder::Close returns to resource dispenser.
-
The resource dispenser calls IHolder::Release. The holder now deletes itself.
-
The method called in step 2 now returns.
-
Release your final reference to the resource dispenser, which now deletes itself.