[Xapian-discuss] value range in perl

Jim Spath jspath at pangeamedia.com
Fri Oct 26 21:40:50 BST 2007


Olly Betts wrote:
> On Fri, Oct 26, 2007 at 02:08:42PM -0400, Jim Spath wrote:
>> I think I figured out the problem after much digging and searching:
>>
>> $qp->add_valuerangeprocessor(new 
>> Search::Xapian::DateValueRangeProcessor(0));
> 
> If you're using 1.0.0.0 still, you need to assign the
> DateValueRangeProcessor object to a variable with the same lifetime as
> $qp or else it will be deleted by Perl - like so:
> 
>   my ($vrp, $qp);
> 
> [...]
> 
>   $vrp = new Search::Xapian::DateValueRangeProcessor(0);
>   $qp->add_valuerangeprocessor($vrp);
> 
> 1.0.1.0 "fixes" this by incrementing the reference count - this means
> such objects are leaked at the moment, but that seems preferable to
> crashing until I sort out a proper fix.

We upgraded to 1.0.2... turns out only the Perl module was at 1.0.0, 
whereas Xapian core was already 1.0.2.

I'm a bit confused about the nature of the leak.

Do both of these leak in 1.0.2?

====

   $qp->add_valuerangeprocessor(
     new Search::Xapian::DateValueRangeProcessor(0)
   );

====

   my ($vrp, $qp);
   [...]
   $vrp = new Search::Xapian::DateValueRangeProcessor(0);
   $qp->add_valuerangeprocessor($vrp);

===

Thanks!
Jim




More information about the Xapian-discuss mailing list