|
EventuallyFreeMemory Method
|
|
|
Applies To
|
BasicTcl Object, AdvancedTcl Object
|
|
Prototype
|
EventuallyFreeMemory(Interpreter As Long, ClientData As Long, FreeProcedure As Long) As Long
|
|
Input
|
The "Interpreter" parameter, which must be a valid interpreter pointer.
The "ClientData" parameter, which is the handle to eventually free.
The "FreeProcedure" parameter, which is reserved for future use and must be zero.
|
|
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 will be freed when the reference count reaches zero.
|
|
Description
|
This method is a wrapper around the Tcl_EventuallyFree function.
|
|
Notes
|
The "FreeProcedure" parameter is not currently used.
Instead, Tcl_Free is called when the handle needs to be freed.
Therefore, the handles passed to this function must have been allocated using the AllocateMemory method or the Tcl_Alloc function.
|
|
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 |