Walter Meester
HoogkarspelPays-Bas
Information générale
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Network:
Windows 2008 Server
>>
>>Parameter objects are passed by reference. The temptation is for Child.Init() to simply store that reference somewhere (because that's easy), then use that to access the passed properties. If at some point the original parameter object disappears, but after that the child needs to access its properties via the stored reference, what happens then?
>>
>>Yes, this can be avoided by the child storing the individual parameter object properties, at which point the object reference can be discarded. But that takes extra work and isn't obvious.
>>
>
>An object will not be released as long as at least one reference to it exists. Storing reference to the parameter object in a property of the child form guaranteed that it'll be available as long as form exists.
That is not correct. You can explicitely destroy objects, such a forms, or objects in collections, which will set any reference to NULL
Précédent
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement