Information générale
Catégorie:
Programmation Orientée Object
Titre:
How to release and assign an object
Versions des environnements
I wonder whether I could get some feedback on the following problems.
I have a few lines of codes to create an object, use it, and release it later.
o1 = createobject("my_object")
......
oCurrent = o1
... do something with oCurrent ....
o1.next = createobject("my_object")
oCurrent = o1.next
... do somethig with oCurrent ....
&& now I try to release to objects
release oCurrent
release o1
My questions are:
1. does oCurrent = o1.next copy the object or just the reference of the object?
2. does release oCurrent release the memory acquired in 2nd createobject?
3. does release o1 release the memory for both createobject(...) even without the release oCurrent?
Suivant
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