11-26-2009 09:18 AM
I am using the EasyTab_ConvertFromCanvas to load tabs onto a panel.
However, when using DiscardPanel, memory is never released according
to the resource tracker.
See attached example, if the call to EasyTab_ConvertFromCanvas
is commented out, memory is released using DiscardPanel.
We are using the CVI 9.0.1 RTE and tried the CVI 9.0 and 9.0.1
compilers.
Has anyone experienced this?
Thanks.
11-30-2009 09:34 PM
Hi kcliche,
I was able to reproduce this behavior and it has been reported to R&D (#197837) for further investigation. One thing that you may want to look into is using the native tab control that can be accessed through the Control menu when you create your GUI. Thanks for the feedback!
12-01-2009 02:53 AM
12-01-2009 11:16 AM
I have added the following to the attached example project and still see memory not being released
in the resource tracker.
DisplayPanel (iPanelHandle);
RunUserInterface ();
EasyTab_RevertToCanvas(iPanelHandle, PANEL_CANVAS);
DiscardPanel (iPanelHandle);
Is this correct?
Thanks,
Kevin
12-02-2009 01:46 PM
Hi Kevin,
Upon looking at this closer I do not think that there is actually a memory leak. When I first ran through it with the resource tracker, I saw I had a Thread-local variable and a List type remaining, which I think is what you saw. I found later that if I right-clicked on these to select "Break on Deallocation", and closed TestStand, I saw where this memory was being released. You can test this as well by including easytab.c and toolbox.c and making the selection that I had mentioned. Please let me know if you are seeing something else.
12-03-2009 05:29 AM
12-03-2009 08:03 AM
Hi Kelly R,
Yes, when trying what you suggest I see a thread variable and a list type left
over in the resource tracker (attached in image).
I would have thought that if in the resource tracker, it did not state "There are
no allocated resources" then something is wrong.
We are currently in the process of investigating random crashes and are trying
to detect and eliminate all leaks.
Can it be certain that this is not a leak?
Can we assume that if the resource is not in the memory tree of the resource
tracker it is not a leak?
Regards
12-04-2009 03:39 PM
Hi Kevin,
I am certain that this is not a memory leak. I think the issue is the memory is just not being released where you expect. Again, it is helpful to select "Break on Deallocation" as I had mentioned in my previous post so you can see exactly where this memory is being released. Remember you need to close TestStand to finish your debugging session. A memory leak only exists when a resource is left in the resource tracker after this debugging session is ended.
Also the EasyTab_RevertToCanvas function that others have mentioned is not required to release any memory. This function was used before we created the native tab control on the GUI, and it was used to convert the control back to a canvas control when the user exits operate mode in the UI Editor. I hope this clarifies things.
02-02-2015 10:50 AM
This thread is very old, but I am seeing the exact same thing now. I feel like I haven't seen this before, but when updating an older program it occurs. I'm using CVI2010 with Resource Tracking.
Following all previous advice, it looks like the memory left open is there from calling EasyTab_LoadPanels(..)
Discarding individual panels, calling RevertToCanvas, discarding the Ctrl, and discarding the main panel do not solve this.
"Multithreading library->Thread-local variable 1" is always left open along with a "Toolbox-> List Type 0x####"
This causes a Fatal Run-Time Error with an unknown fault EVERY TIME I run my program in the IDE.
02-03-2015 05:07 PM
Hi ngay528,
I would suggest creating a new thread with a fresh description of your issue and a link to this thread.
Are you using the same code that was provided in the original post? It would also be beneficial to know at what point the Fatal Run-Time Error occurs. I assume you are unable to the "Break on Deallocation" step suggested by Kelly_R because of the error, is that correct?