About Terminal Server, Citrix, Delphi and other stuff
Again a about post about using the Virtual TreeView component (did I mention it’s brilliant?), this time I will talk about memory leaks.
I often use Records to hold the treedata, and usually the record holds some string data (eg a caption) and an (a reference to) an Interface or Object(List) that holds more data.
If you are familiar with Virtual Tree then you know that you must can the NodeData in the OnFreeNode event.
Let’s look at an example:
Looks allright doesn’t it? And still if you test for memoryleaks with Eurekalog or FastMM you will sometimes notice some leaks.
This happens because Virtual Treeview only calls the OnNodeFree event for Validated Nodes and a node that was never “touched” (eg the node was never visible and thus the GetText event was never called) was never validated.
In these cases you can manually validate the node when adding it
Related posts:
Active Directory Altiris bug Citrix Dell Delphi Exchange Exchange2003 Exchange2010 Hewlett-Packard HP iOS Jailbreak Java LinkedIn Linux MSI MySQL Navigation Objects Office Outlook Passat PowerPoint PowerShell referall was returned RNS315 RNS510 SasLibEx script slow Terminal Server ThinApp TSAdmin TSAdminEx VBS VCDS Vista VMWare Volkswagen Windows PE WLAN Wordpress WTSWaitSystemEvent wts_event_flush
WP Cumulus Flash tag cloud by Roy Tanck requires Flash Player 9 or better.
One Response for "Memory Leaks when using the Virtual TreeView Component"
I too love that treeview component and was unaware of the need to have a node validated for that event to be called. Time to check a lot of code to be sure
Thanks for the tip!
Leave a reply