Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
When I release last object reference, what should happen
Message
 
À
19/07/2000 15:57:17
Information générale
Forum:
Visual FoxPro
Catégorie:
Programmation Orientée Object
Divers
Thread ID:
00394466
Message ID:
00394623
Vues:
14
>If the only reference to the object is a variable, then that object should be >destroyed when the variable is cleared or goes out of scope. Is there >something you're not telling us?

Thanks, Eric. I think I see my problem. I did have another reference to it hanging around -- inside. So I'm glad I wasn't misunderstanding the object model.

Let me explain what I'm really trying to do.

I want to create a "Timer Manager". Anyhow, I'm just experimenting. I want to to run in a new data session, so as not to screw up other things. I'm doing this all in code. I created a session object, gave it a property oTIMER, and put a timer therein. Now, how do I connect make timer event of that timer do anything? I tried to create a procedure oTIMER.TIMER, but it didn't like that.

If I started with a CONTAINER instead of a SESSION I could add the timer and then the whole thing would work.

So I took my generic subclass of TIMER and gave it two properties: OnTimerMethod and OnTimerObject. When the timer goes off, it executes (basically) this.OnTimerObject.&OnTimerMethod(). All that worked, but ... aha! .. there is my other reference to the timer.

Interestingly enough,
goTimerMgr.destroy ... works, it really destroys the TimerMgr,
but = goTimerMgr.destroy() ... just calls the destroy method

(Or at least that's what I THINK happens.)

I have a feeling I'm doing this the wrong way. Any suggestions?

Thanks.
Tom Green in Montreal
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform