01-10-2012 10:07 AM
Hi,
I'm in a little trouble with "close reference.vi". Suppose, I have an active-x or .net references, and:
And an example:
Suppose, I have a .net / active-x ref. and an invoke/property node call returns a new reference. Can I close the parent reference earlier then a called reference?
I have many questions about this topic, so I think the best could be if someone suggest me a good topic e-book or community blog maybe I can find some useful advices!
Thank you so much!
01-10-2012 11:01 AM
- When do I have to close these references?
- When you done wlith it.
- Do I have to close them?
- Yes. You do.
- What does happen when I close them?
- Release allocated memory.
- What could happen if I dont close them?
- Could casue memory leak.
- All Opened references must be closed?
- Yes.
And an example:
Suppose, I have a .net / active-x ref. and an invoke/property node call returns a new reference. Can I close the parent reference earlier then a called reference?
Keep parent ref open, until all child ref closed.
I have many questions about this topic, so I think the best could be if someone suggest me a good topic e-book or community blog maybe I can find some useful advices!
See LabVIEW menu.
01-10-2012 06:37 PM
I have seen it stated that if the reference number does not change between instances of an application, it does not need to be closed. I have seen it where certain property node references do not change. What or how it is determined to use the same reference number, I don't know. But I have gotten into the habit of closing them anyway. Your parent reference should be the last reference closed (close them in the reverse order they are opened).
Perhaps someone else can better explain how reference numbers are allocated and why some don't change and others do.
01-11-2012 11:37 AM
All ActiveX and .NET references should be closed - even ones that you do not explicitly open, such as references returned by ActiveX and .NET property nodes. References to LabVIEW items - such as front panel controls - do not need to be explicitly closed. See this discussion for more information: http://forums.ni.com/t5/LabVIEW/Which-references-need-to-be-Closed/m-p/307175