Re: help needed with array out arguments



Hi!

On Mon, Apr 01, 2002 at 06:01:48PM +0200, ERDI Gergo wrote:
> On 1 Apr 2002, Michael Meeks wrote:
> 
> > 
> > 	If you look in ORBit2/docs/internals/interface-indirection.gnumeric you
> > can see the level of indirection that is used both for ORBit2's
> > ORBit_invoke type thing, and also for the C binding - they are
> > different.
> 
> that's way beyond cryptic. really, I'm only looking for two-three lines of
> code, like (pulled from my butt):
> 
> client:
> 	Test_Numbers_slice *numbers = 0;
> 	Test_ITest_foo (numbers);

After using the array numbers, you should release it with CORBA_free()

> 
> server:
> 	skel_Test_ITest_foo (Test_Numbers_slice *out_array)
> 	{
> 		out_array = Test_Numbers__alloc ();
> 		// Fill out_array
> 	}
> 

Server code is fine.

	So, if I understood well, only adding a CORBA_free(numbers) when
you're finished with the array on the client side the code would be
right as for memory management issues.

	Best regards.
	diego

-- 
Diego Sevilla Ruiz  http://ditec.um.es/~dsevilla  dsevilla@um.es  \    /\
Dpto. Ingeniería y Tecnología de Computadores http://ditec.um.es   )  ( ')
Visiting Extreme! Computing Lab       http://extreme.indiana.edu  (  /  )
Indiana University, Bloomington               http://www.iub.edu   \(__)|



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