>Hi you all,
>
>Just a quick question for those of you who have used and abused VFP end-of-life additions, VFP collections.
>
>Up to now, I resisted the urge to use VFP collections. They a bit clumsy as compared to the support for them in say python and a couple of other languages ones. But well I decided to use them for a relatively complex VFP task (with text and xml-via-com parsing).
>
>The good news: it worked and was reasonable simple. The bad one: memory leaks and COM -(and VFP-based) objects lost at runtime.
>
>I first had the initial bad reaction most have in front of mem leaks - nobody like these dangling references ! I then read a nice post by Rick Strahl on his great web site. Once i was back to life... I decided to replace a couple of collections with arrays. It worked wonderfully. The garbage collector would get back to work. Good news:)
>
>I still have numbers of VFP collections in this relatively complex pack of code. A few questions on VFP collection good practices:
>
>1) Would you recommend that I drop them all ? Or can we safely keep them for basic purposes such as collection of integers !
>2) Can you safely add and remove them dynamically with ADDOBJECT and REMOVEOBJECT and expect the garbage to be collected?
>
>Daniel
I am not a fan of collections and I don't use them. Arrays and custom (and mostly "Empty") object does good for me in most cases.
I chimed in to ask about that "text and xml via com parsing". That sounds to be a bigger problem. I would try keeping away from COM unless absolutely needed. Maybe you could parse via XMLAdapter and remove the need to collections completely?