Information générale
Catégorie:
Programmation Orientée Object
Versions des environnements
Network:
Windows 2008 Server
>>>Just a mind experiment, and before I try it myself, want to check if anyone already did this.
>>>
>>>Create an object, assign it to a local variable. Then bindevent() something to one of this object's methods.
>>>
>>>What happens when the variable goes out of scope? I'm expecting that the binding doesn't increase reference count, so the object will destroy and the binding will vanish. Correct?
>>
>>When the object is released (or the var that holds it is out of scope), all events are automatically unbinded.
>
>Ah - that's it, I wasn't sure it's completely automatic. Well, thanks for confirming.
Did not check experimentally, but remember that it was documented that Bindings to Win events are unbound when the event holder is destoyed (what else would make sense...)
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