On Wed, 11 May 2011 19:49:15 -0300
Leonardo M. Ramé <l.r...@griensu.com> wrote:

>[...]
> > >     if @lGetDicomImage <> nil then
> > 
> > if lGetDicomImage <> nil then
> > 
> > What mode are you using? Delphi?
> 
> No, I'm using objfpc. 

Then the "if @lGetDicomImage <> nil then" is a tautology.


> > >         if @lDeleteBuffer <> nil then
> > >           lDeleteBuffer(lBuffer); // <----- memory keeps increasing here.
> > >       end;
> > 
> > end;
> > if lBuffer<>nil then
> >   lDeleteBuffer(lBuffer);
> 
> I don't understand this. Do you mean, I should call lDeleteBuffer aftert
> the "end;" that closes the loop?.

Yes. The C code was not enough to be sure about the state of lBuffer.

BTW, I'm not sure about the "out" in cdecl. Better use the real
equivalent "var".


Mattias
 

--
_______________________________________________
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply via email to