Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Removing objects
Message
De
07/01/1999 12:49:54
 
 
À
07/01/1999 12:05:25
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Divers
Thread ID:
00172935
Message ID:
00173640
Vues:
48
>I noticed something about RemoveObject. If you issue RemoveObject and AddObject (with the same name) in sequence, you'll find that AddObject fails because the object still exists :-
>
>.RemoveObject('abc')
>.AddObject('abc','cClass')
>
>This seems to happen in VALIDs. The RemoveObject is called, but not until all the VALID code is executed, that the RemoveObject (from FORM) fires. It's like the VALID logged a message with the main VFP event handler to RO, then the VALID code finishes furst, then only the message is handled in the FORM's event loop.
>
Kenneth,

Since VFP is multi-threaded, I would not be surprised if potentially lengthy operations like removeobject are not relagated to a second thread. Which would mean in this case that while the alternate thread is removing the object, the primary thread attempts to add it, which causes an error because the object still exists at that instant.

Definately something to look at. This would expain why Debug/Trace shows the code proceeding even though the container object has (visually at least) not yet been removed.

Good thought.

regards,
Jim Edgar
Jurix Data Corporation
jmedgar@yahoo.com

No trees were destroyed in sending this message. However, a large number of electrons were diverted from their ordinary activities and terribly inconvenienced.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform