08-14-2018 01:03 AM
A lot of times I have problem with Labview programs:
When I open handles of DLL-s or some hardware handles, then if this handles does not close properly I have to close Labview completely so that Labview releases handles and then I can calculate handles again.
Is there any other way to close, kill, stop al resources directly from Labview without closeing it? Is there any function like "kill-all-handles" or something similar?
Solved! Go to Solution.
08-14-2018 01:12 AM
Hi Skoda,
how do you open "DLL handles" or "some hardware handles"?
Usually there always is a CloseReference function for each OpenReference function.
Examples: OpenFile vs. CloseFile, OpenVIRef vs. CloseReference, AutomationOpen vs. CloseReference, DAQmxCreateTask vs. DAQmxClearTask…
08-14-2018 04:17 AM
The solution is, as GerdW already pointed out, to keep track of those handles and close them explicitly when you are done with them. That is proper resource handling.
Windows keeps track of all memory allocations and OS handles created within a process and will clean them up when the process terminates but there is NO functionality to tell Windows to close those resources other than terminating the process, simply because you do not want all resources being closed unless the process terminates. If this function would exist and you would call it, the process would crash immediately because that function would inevitably also close resources that your process still is using!