Dave Rolsky <[EMAIL PROTECTED]> writes:
> On 8 Jul 2002, Joe Schaefer wrote:
[...]
> > my $r = shift;
> > my $apr = Apache::Request->new($r);
> >
> > That's not going to leak, either. At least I hope not :-)
>
> I ended up using something like this and the leak went away.
>
> It seems to me that this might actually be a Perl bug.
I doubt it's solely perl's fault. The problem is that you
have to be an internals wizard to write "safe" XS; otherwise
you just keep your fingers crossed. :-)
Hopefully some generous soul will post a patch to Request.xs that
prevents this problem from ever arising.
> If I do this:
>
> my $x = shift;
> $x = make_something_from($x);
>
> then it seems like the original $x should go out of scope when it is
> assigned to, so its refcount should stay at 1.
^^^^^^
Right, it should stay at 1. But all bets are off when
$x is has magic and make_something_from() is an XS sub :-).
--
Joe Schaefer