[omniORB] freeing out-parameters

Weigl Christoph christoph.weigl@fee.de
Wed, 31 Jan 2001 09:24:14 +0100


Hi,
I'm sure this question has been asked before, but I can't find the 
postings and the following problem is very important for us:
We have a server which uses sequences as out-params to pass 
results to clients.

  void CPze::getProjectList(const char* von, const char* bis,       
  CORBA::Boolean sortById, ObjList_out projects)
  {
    (...)
    projects = new ObjList;
    projects->length (size);  // CORBA-size eintragen...

    while (....)
    {
      ObjDescr *x = new ObjDescr;
      // get a pointer to a p object from a database...

      CString s;
      s.Format ("%d", p->ID);
      x->Id = CORBA::string_dup (s);
      x->Bezeichnung = CORBA::string_dup (p->Bezeichnung);
      (*projects)[index++] = *x;
      (...)
     // delete the p-pointer
  }

  ObjList and ObjDescr are defined in the .idl-file:
  
  struct ObjDescr
  {
    string Id;
    string Bezeichnung;
  };  
  typedef sequence <ObjDescr> ObjList;
 
Now, my problem is that the server seems to eat the "out-param" 
memory. In my opinion, the orb sould be able to delete all allocated 
memory after passing the out-param to the client (am I wrong 
here?).
What must i do to get this memory freed?


Thanks for reading,
Chris

Mfg.

Christoph Weigl
Tel.  09672 506-178
Mail: Christoph.Weigl@FEE.De