2-4
SOMobjects Base Toolkit: Programmer’s Reference Manual
ORBfree Function
Purpose
Frees memory allocated by DSOM for return values and out arguments.
C Syntax
void ORBfree (void* ptr);
Description
The ORBfree function is used to free memory for method return values or out arguments
which are placed in memory allocated by DSOM (versus the calling program). For example,
strings, arrays, sequence buffers, and “any” values are returned in memory which is
dynamically allocated by DSOM.
Parameters
ptr A pointer to memory that has been dynamically allocated by DSOM for a
method return value or out argument.
Example
#include <somd.h>
#include <myobject.h> /* provided by user */
MyObject obj;
Environment ev;
string str;
/* assume myMethod has the following IDL declaration
* in the MyObject interface:
*
* void myMethod(out string s);
*/
_myMethod(obj, &ev, &str);
...
/* free storage */
ORBfree(str);
Related Information
Functions: SOMD_NoORBfree
This function is described in section 5.16, “Argument Passing Considerations”, and section
5.17, “Return Result Passing Considerations”, of the CORBA 1.1 specification.
Kommentare zu diesen Handbüchern