ClassDestroy Function | |
Remove the class object of class.
Namespace:
XSharp.XPP
Assembly:
XSharp.XPP (in XSharp.XPP.dll) Version: 2.19
Syntax FUNCTION ClassDestroy(
uObject
) AS LOGIC CLIPPER
[ClipperCallingConventionAttribute(new string[] { ... })]
public static bool ClassDestroy(
Usual uObject = default
)
Request Example
View SourceParameters
- uObject (Optional)
- Type: Usual
The name of the class whose class object should be deleted, or the class object.
Return Value
Type:
LogicThe return value is .T. (true) when the class object is removed from memory, otherwise it is .F. (false).
Remarks The function ClassDestroy() removes the class object of a dynamically created class from main memory.
Dynamic classes are created during runtime by the ClassCreate() function. They are unknown at compile time.
Therefore, they do not have a class function and are represented at runtime of a program only by a class object.
When a program uses a dynamic class, the corresponding class object should be removed from main memory when the class
is no longer needed. Otherwise, the class object remains in memory and can be retrieved by the ClassObject() function at any time.
NoteIn X# classes are never really freed from memory. The .Net framework does not allow that. ClassDestroy() does remove the class
from the list of active classes. If you recreate the same class later with the same structure then the class definition from the previous
defintion is reused.
See Also