The Help for the RELEASE command of both VFP 5 and VFP 6 summarizes its function (in the header statement) as follows:
"Removes variables and arrays from memory"
Now this does not explicitly state that OBJECTs are included in the scope of the RELEASE command, but the "Developer's Guide" (VFP 5) and the "Programmer's Guide" (VFP 6) - on page 72 of each - explicitly states that the RELEASE command will clear OBJECTs from memory. Both, though, also qualify this functionality stating that if the OBJECT has a reference to an OBJECT belonging to it still in existence, then the OBJECT itself will not be released from memory until such other existing direct OBJECT references have all also been released.
Rudimentary testing confirms all of the above for OBJECTs and OBJECT references in VFP programs. However, the following was also observed in that testing:
But most developers hardly have a chance to become fully aware of the situation - it is not mentioned at all in the Help for RELEASE and it is related in all of four (4) lines in a thick guide.
The consequence of this is that a developer will only become aware of the situation after they have experienced a program malfunction as a result. Worse still, such a malfunction is most likely to occur after implementation, when the application finally encounters sustained usage with much higher transaction volumes than were ever done in testing. Even with a malfunction experience, the vast majority of developers (98%+) will have to dig awfully carefully through a guide to catch this one. Remember, they 'know' (and see) the RELEASE command and have no reason at all to suspect it as the source of the problem(s), especially when they can display memory and confirm that the memvar is no longer there! It would take a psychic to link the failure to the RELEASE command. The less than 2% of VFP developers who use the UT (or similar FOX-related forums on-line) have a much better chance to learn the true facts.
How should the behaviour of RELEASE, for OBJECTs, be revised?
A) The best revision would be as follows:
B The next-best alternative is as follows:
This would permit the developer to quickly correct the problem without the necessity of fore-knowledge available in only four (4) lines buried in a thick book.
C The worst of the suggested alternatives is: