2-7
DSOM Framework Reference
somdExceptionFree Function
Purpose
Frees the memory held by the exception structure within an Environment structure,
regardless of whether the exception was returned by a local or a remote method call.
C Syntax
void somdExceptionFree (Environment *ev);
Description
The somdExceptionFree function frees the memory held by the exception structure within
an Environment structure, regardless of whether the exception was returned by a local or a
remote method call.
When a DSOM client program invokes a remote method and the method returns an
exception in the Environment structure, it is the client’s responsibility to free the exception.
This is done by calling either exception_free or somdExceptionFree on the Environment
structure in which the exception was returned. (The two functions are equivalent. The
exception_free function name is #defined in the som.h or som.xh file to provide strict
CORBA compliance of function names.) There is a similar function, somExceptionFree,
available for SOM programmers; DSOM programmers, however, can use
somdExceptionFree to free all exceptions (regardless of whether they were returned from
a local or a remote method call).
Parameters
ev The Environment structure whose exception information is to be freed.
Example
X_foo(x, ev, 23); /* make a remote method call */
if (ev–>major != NO_EXCEPTION)
{
printf(”foo exception = %s\n”, somExceptionId(ev));
/* ... handle exception ... */
somdExceptionFree(ev); /* free exception */
}
Related Information
Functions: somExceptionFree, somExceptionId, somExceptionValue,
somSetException (all SOM kernel functions)
Data structures: Environment (somcorba.h)
Komentáře k této Příručce