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

Hautesserres, Thomas thomas.hautesserres@managedstorage.fr
Thu Feb 13 08:39:02 2003


To: "Dave Vaughan" <dave.vaughan@thales-is.com>
cc: omniorb-list@omniorb-support.com
Subject: Re: [omniORB] Memory Leak in Unmarshal (OmniOrb 4.1/VC7) 
From: Duncan Grisby <duncan@grisby.org>
Date: Wed, 12 Feb 2003 11:20:33 +0000

> 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);

Just a comment about Duncan's code:  if the last three parameters are OUT
parameters, shouldn't the execute() method be called as :

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

to insure that memory is released by the _var variables before the call is
made?

Thomas