[omniORB] Memory Leak in Unmarshal (OmniOrb 4.1/VC7)

Duncan Grisby duncan@grisby.org
Wed Feb 12 11:21:01 2003


On Tuesday 11 February, "Dave Vaughan" wrote:

> 6. My call on the interface looks like this:-
> 		(*mysql)->execute (QueryTemp,*resout,*updatecount,*corbawarnout);
> Where SQLStatement_var *mysql;
>       ResultSets_out	*resout;
> 	UpdateCounts_out *updatecount;
> 	CorbaSQLWarnings_out *corbawarnout;

You should not use the _out types. They are internals helpers that
application code should never use directly.

Also, you should not make pointers to _var types -- that defeats the
point of them which is that they release whatever they are holding
when they go out of scope. Your call should look something like

  SQLStatement_var mysql = ...;
  ResultSets_var resout;
  UpdateCounts_var updatecount;
  CorbaSQLWarnings_var corbawarnout;

  mysql->execute(QueryTemp, resout, updatecount, corbawarnout);


Get "Advanced CORBA Programming with C++" and read all the stuff about
memory management.

Cheers,

Duncan.

-- 
 -- Duncan Grisby         --
  -- duncan@grisby.org     --
   -- http://www.grisby.org --