Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Object Creation and Releasing (or not)
Message
De
03/09/2008 09:12:35
Jay Johengen
Altamahaw-Ossipee, Caroline du Nord, États-Unis
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Vista
Network:
Windows 2008 Server
Database:
MS SQL Server
Divers
Thread ID:
01344428
Message ID:
01344455
Vues:
21
>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.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform