A simple interfance to help track and clean up .NET reference in a way that keeps your block diagram looking clean.
Properly cleaning up .NET references can quickly get out of hand. Typical .NET code creates a lot of references that are only used for a short period of time.
This toolkit help developers keep track of these reference and easily close all of them only once they're no longer need.
Call Reference Cleanup.lvclass:Reference Cleanup.vi
to initialize the reference counter.
Next, when new .NET reference is crated, add it to the counter by calling Reference Cleanup.lvclass:Add Reference.vim
Finally, when you're done with all of the references, call Reference Cleanup.lvclass:Cleanup.vi
References are tracked using the VI that created them. When the Reference Cleanup
object is created, a named queue is created based on the calling VI's name. Next when Add Reference
is called the call chain is searched for an existing cleanup queue, and the reference is added to it.
So typically a VI will initialize the Reference Cleanup
at the start of execution. Perform all of it's .NET related tasks (and just add reference as they're created) then finally close all references at the end of execution.
Any references that implements the .NET IDisposable
interface will be disposed of before closing.
See Contributing.md for information on how to submit pull requests. Bugs can be reported using the repositories issue tracker.
Initial Release.
Copyright (c) 2018 Moore Good Ideas, Inc . All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. Neither the name of Moore Good Ideas, Inc nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.