miyagawa / AnyEvent-Redis

Asynchronous Redis client
http://search.cpan.org/dist/AnyEvent-Redis
41 stars 16 forks source link

Premature release of $strong_self #25

Open michaelfig opened 7 years ago

michaelfig commented 7 years ago

I commented on the commit that introduced weaken $self.

With the code I attached in there, I don't see the problem of $self going to undef while commands are still pending.

Without my patch, if I have a long-running AnyEvent process that fires off commands and lets the handle go out of scope, I get undefined $self errors even though $cmd_cv has not yet been sent.

Thanks, Michael.

michaelfig commented 7 years ago

26 introduces the needed change.