Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Possible WISH LIST item?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00149579
Message ID:
00150188
Vues:
34
>My concern is 'inside' a VFP app., where I might instantiate/reference who knows what, who knows when.

Is this really the way your code is written? I doubt it, Jim. :)

>It sure looks to me like VFP is either relying on the OS reference count or maintaining its own blindly applying the OS's "rules"

I very much doubt that VFP is bothering with any Windows functionality simply to keep track of the number of clients of an object in VFP code. This really doesn't have anything to do with Windows. Reference counting to aid memory management and garbage collection is a general-purpose technique, found in a lot of programming.

>And, as said previously, (a) any command which doesn't do the full job one expects it to do ought to report back that status for further processing,

It all depends on what you expect it to do, doesn't it? If your expectation is that RELEASE X should obliterate the object that X refers to, then yes, RELEASE isn't doing what you expect. If instead you realize that RELEASE X merely decrements a reference count, then there should be no surprises (nor error messages).

>what business does it have holding on to anything I said to release (even if I did so prematurely)?

You just said to decrement the reference count. That's part of the definition of the language. RELEASE is performing to spec.

>Just because people have found some 'straightforward coding practises to eliminate the problems this poses is no reason to further simplify the coding for everyone generally, and this is the nub of what I believe would be a GOOD REVISION.

People have posted code to completely remove an object from memory. Whether this is necessary or not (i.e., solves a "problem") depends on how tightly woven your interobject relationships are. If they are tightly interwoven, you have a couple of solutions. Frankly, it doesn't sound very encapsulated to me to unconditionally remove an object from memory, since that requires knowledge of every possible client of that object. In a way, VFP better supports the "who knows what, who knows when" you mentioned above.

However, I agree it's sometimes necessary. The question is whether VFP's whole reference counting behavior is flawed, and I don't see any evidence that it is. Just as with my problem where focusing a grid changes the workarea, it was a design decision that weighed one factor against another, and this can cause confusion.

But when you realize what RELEASE X was meant to do, and what it does, the confusion goes away.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform