Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Object Creation and Releasing (or not)
Message
From
03/09/2008 09:12:35
Jay Johengen
Altamahaw-Ossipee, North Carolina, United States
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Vista
Network:
Windows 2008 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01344428
Message ID:
01344455
Views:
20
>Hi Jay,
>
>I'd keep record references only constantly available if the cost of creating the object is high. That's the case with out-of-process servers, especially those that are regular applications like Word, Excel, etc. Classes such as the XML parser, however, are comparable light class that are quickly to instantiate. On my machine it takes like 50 ms to instantiate 1000 of these objects. Therefore I would create a new object whenever I need one and store in a local variable.

The original reason I moved it to _SCREEN was to avoid memory leaks. Someone (Craig maybe?) said that active x objects tended to have issues with that. What would be the best way to avoid that and still create them as needed? Would I create as needed, then set each property of the object to NULL, then set the object to NULL, then I'm good to recreate again? Could I just set the local variable (the object reference) to NULL before I create the next one? Just trying to understand this well so I don't keep running into the same issues.
Previous
Reply
Map
View

Click here to load this message in the networking platform