[omniORB] Client-side leak using Sequence<Any> as an out parameter

david.sansom@db.com david.sansom@db.com
Thu, 23 Mar 2000 16:47:09 +0000



Sorry all. I've now looked through the archive and seen the "[omniORB]
Extraction of strings from Any" conversation thread from May last year.

My leak comes from the
CORBA::Boolean CORBA::Any::operator>>=(char*& s) const;
call.

I'm deliberately not freeing the returned string (as directed by Henning
& Vinoski, and the omniORB Any example anyExample_impl.cc (!) ). If I
ignore them and call CORBA::string_free() on the pointer my leak goes
away.

DS.


---------------------- Forwarded by David Sansom on 23/03/2000 16:28
---------------------------


From: david.sansom@db.com on 23/03/2000 12:08

To:   omniorb-list@uk.research.att.com
cc:
Subject:  [omniORB] Client-side leak using Sequence<Any> as an out
      parameter





Hi,

I seem to be picking up a sizeable client-side memory leak (MSVC 5 / NT
4.0 / OnmiOrb 2.7.1) when using a Sequence of Anys as an out variable.
My interface (simplified) provides a simple SQL query function : you
supply a string of Sql, and you get back the number or rows, number of
columns, and the data in a vector (lRows * lCols elements) of Any.

IDL:

interface Query
{
  typedef sequence<any> ResultSet;

  long selectQuery(in string selectSQL, out long rows, out long cols,
out ResultSet results);
};

Client Code:

Query_var qv;

//Create Query_var object etc
....
//

{
  CORBA::String_var strQuery(CORBA::string_dup("Some Sql"));

  CORBA::Long lRows = 0;
  CORBA::Long lCols = 0;

  Query::ResultSet_var vrs;

  CORBA::Long lRet = qv->selectQuery(strQuery,lRows,lCols,vrs);
}

I seem to leak on each and every call to selectQuery, even though I
might have hoped that when the Query::ResultSet_var goes out of scope it
would tidy up after itself.

Am I missing something simple ?

David Sansom
Fixed Income & Relative Value Research
Deutsche Bank AG (London)
0171 545 4886
david.sansom@db.com