ReleaseMemory Method
Applies To
BasicTcl Object, AdvancedTcl Object
Prototype
ReleaseMemory(Interpreter As Long, ClientData As Long) As Long
Input
The "Interpreter" parameter, which must be a valid interpreter pointer. The "ClientData" parameter, which is the handle to release.
Output
None.
Returns
Undefined.
COM Results
S_OK: Success.
E_INVALIDARG: Either a NULL pointer was passed or the "Interpreter" parameter is invalid.
Side Effects
The handle is released using the Tcl reference counting mechanism. When the reference count reaches zero and the EventuallyFreeMemory method has been called, the Tcl_Free function will be called.
Description
This method is a wrapper around the Tcl_Release function. The PreserveMemory and ReleaseMemory methods should be called an equal number of times on any given handle.
Notes
None.
Example
Private Sub Command1_Click()
    Dim poTcl As TclBridge.BasicTcl
    Dim plHandle As Long

    Set poTcl = New TclBridge.BasicTcl

    Call poTcl.AllocateMemory(plHandle, 100&, 0&, 0&) ' allocate 100 bytes

    Call poTcl.PreserveMemory(plInterpreter, plHandle)

    Call poTcl.EventuallyFreeMemory(plInterpreter, plHandle, 0&)

    Call poTcl.ReleaseMemory(plInterpreter, plHandle)

    Set poTcl = Nothing
End Sub