using CORBA_exception_free on memory taken in stack?



hi,
  i am new to orbit2.i have recently started using it to build my corba application.
i was going through the code given on the orbit official website 'echo client and echo server'
  have a look at first function :

static void
abort_if_exception(CORBA_Environment *ev, const char* mesg)
{
    if (raised_exception (ev)) {
        g_error ("%s %s", mesg, CORBA_exception_id (ev));
        CORBA_exception_free (ev);
        abort();
    }
}

this is using CORBA_exception_free(ev)  ... but when it is called the ev points to the memory taken on stack
        

CORBA_Environment  local_ev[1];
.......
abort_if_exception (local_ev, "caught exception");

Is it safe to use it this way? If it is then what the function CORBA_exception_free is doing ?.

thanks,
surendra.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]