IPB_Session interface:
ReleaseValue method
Description
Frees the IPB_Value acquired using AcquireValue or AcquireArrayItemValue.
Syntax
1 |
ReleaseValue(IPB_Value* <span>value</span>) |
Argument |
Description |
---|---|
value |
The string to be released from memory |
Return Values
None.
Examples
The AcquireValue method is used
to obtain a message argument value. Later, when the value is no
longer needed, it is released using ReleaseValue to
avoid memory leaks:
1 |
// Acquire a value<br>MessageArg = session->AcquireValue<br>   ( ci->pArgs->GetAt(0) );<br>pbstring pbMessage = MessageArg->GetString() ;<br>Message = (LPSTR)session->GetString(pbMessage) ;<br>...<br>// Cleanup phase<br>if (MessageArg)<br>{<br>   Session-><span>ReleaseValue</span> ( MessageArg ) ;<br>} |
Usage
When you no longer need the data acquired using the AcquireValue or AcquireArrayItemValue method,
you must call the ReleaseValue method
to free the data. Failing to do so causes a memory leak.
Do not use ReleaseValue to release
a value that was not acquired using AcquireValue or AcquireArrayItemValue.
If you do, the PowerBuilder VM might crash.
See Also
Document get from Powerbuilder help
Thank you for watching.
Subscribe
Login
0 Comments