On my CORBA server I have allocated memory for an out parameter of
type CORBA sequence. I have used c++ "new" to allocate the memory. Now
I want to make sure that the memory gets freed so how should I go
about that ?
- Should the client notify the server that it has received the value
of the out parameter and now the server can free the memory.
or
- CORBA will free the memory allocated to the sequence automatically
and I don't need to worry about freeing the memory.
Thanks in advance.
Ganesh
In CORBA all parameters are owned by the calling code. Your code on
server side is called by the ORB runtime, which will free the space
allocated by your implementation. When you are done using the sequence
on the client side, simply release it. You do not need to worry about
releasing the memory on the server side. However, to ensure that your
code works correctly, use the allocbuff method in the sequence class.
Raghu
Using "new" is correct for the sequence object itself. "allocbuf" is
used to allocate a buffer for the sequence object to use as storage, and
is often unnecessary.
--
Jon Biggar
j...@floorboard.com
j...@biggar.org
jonb...@gmail.com