Re: [PATCH] bug 3081: comm layer cleanups for TCP acceptor

From: Alex Rousskov <rousskov_at_measurement-factory.com>
Date: Fri, 21 Jan 2011 13:16:48 -0700

On 01/21/2011 08:55 AM, Amos Jeffries wrote:
> Hmmm, bug in Subscription then.

> - virtual AsyncCall::Pointer callback() const { return new Call_(call); }
> + virtual AsyncCall::Pointer callback() const { return new Call_(call.getRaw()); }
>
> private:
> const RefCount<Call_> call; ///< gets copied to create callback calls

Still does not look right. getRaw() returns a pointer to the call. You
do not want to copy a pointer. You want to copy the call itself:

virtual AsyncCall::Pointer callback() const { return new Call_(*call); }

And if Call_(call.getRaw()) actually compiles, there is another bug
somewhere, allowing a pointer-to-AsyncCall conversion to AsyncCall.

HTH,

Alex.
Received on Fri Jan 21 2011 - 20:17:14 MST

This archive was generated by hypermail 2.2.0 : Sat Jan 22 2011 - 12:00:05 MST