[omniORB] To delete or not to delete....

bjornw@fairplay.no bjornw@fairplay.no
12 Jan 1999 16:55:30 +0100


Hi omniorbers!

Let us say that I have a server that allocates a sequence of elements,
and that the client deletes it. Is that it? The reason I'm asking is
because I have a server that grows and grows and grows ...=20

Here is some pseudo code that illustrate a typical scenario

// idl file
typedef sequence<long> long_seq;

interface server {
  long_seq query();
};

// server-implementation
long_seq *
server::query()
{
	long_seq *ptr =3D new long_seq;
	return ptr;
}

// client implementation
long_seq *ptr =3D server->query();
delete ptr;

bjornw> Sincerely

-------------------------------------------------------
Bj=F8rn Wennberg              email: bjornw@fairplay.no=20
                               ms: +47 950 82 657
Senior Programmer           phone: +47 22405538
FairPlay International AS     fax: +47 22405539