RE: Memory leaks using callbacks
Date: Tue, 13 Nov 2007 09:39:46 -0800
Daniel Stenberg wrote:
> On Tue, 13 Nov 2007, Raquel Vieira wrote:
> Please don't top-post:
> > The variable 'data' is the data that I'm returning from the
> > I'm deleting that variable in the method httpPost that calls the
> > callback.
> Nope. The data is a pointer that is passed to your callback, modifying
> won't help. You need to make the pointer point to something in which
> return data.
No; it's a reference to a pointer already (this is C++), and so it does
modify the caller's pointer. The problem lies elsewhere (though using
new in this manner from C++ code is cause for concern, at least).
Received on 2007-11-13