Ticket #647: xapian.patch

File xapian.patch, 2.0 KB (added by Dmitry Karasik, 10 years ago)
  • .0/Xapian/QueryParser.pm

    diff -ru Search-Xapian-1.2.15.0.0/Xapian/QueryParser.pm Search-Xapian-1.2.15.0/Xapian/QueryParser.pm
    old new  
    3434  return $qp;
    3535}
    3636
    37 my %subrefs;
    38 
    39 sub add_valuerangeprocessor {
    40   my ($self, $vrp) = @_;
    41   $self->add_valuerangeprocessor0($vrp);
    42   push @{$subrefs{"$self"}}, $vrp; # keep a reference
    43 }
    44 
    45 sub set_stopper {
    46   my ($self, $stopper) = @_;
    47   $self->set_stopper0($stopper);
    48   push @{$subrefs{"$self"}}, $stopper; # keep a reference
    49 }
    50 
    51 sub _delete_subrefs { delete $subrefs{"$_[0]"} }
    52 
    53371;
    5438
    5539__END__
  • Search-Xapian-1.2.15.0

    diff -ru Search-Xapian-1.2.15.0.0/XS/QueryParser.xs Search-Xapian-1.2.15.0/XS/QueryParser.xs
    old new  
    2222        THIS->set_stemming_strategy(static_cast<QueryParser::stem_strategy>(strategy));
    2323
    2424void
    25 QueryParser::set_stopper0(stopper)
     25QueryParser::set_stopper(stopper)
    2626    Stopper * stopper
    2727    CODE:
     28        // FIXME: no corresponding SvREFCNT_dec(), but a leak seems better than
     29        // a SEGV!
     30        SvREFCNT_inc(ST(1));
    2831        THIS->set_stopper(stopper);
    2932
    3033void
     
    113116QueryParser::get_description()
    114117
    115118void
    116 QueryParser::add_valuerangeprocessor0(ValueRangeProcessor * vrproc)
     119QueryParser::add_valuerangeprocessor(ValueRangeProcessor * vrproc)
    117120    CODE:
     121        // FIXME: no corresponding SvREFCNT_dec(), but a leak seems better than
     122        // a SEGV!
     123        SvREFCNT_inc(ST(1));
    118124        THIS->add_valuerangeprocessor(vrproc);
    119125
    120126void
    121127QueryParser::DESTROY()
    122     CODE:
    123        {
    124           dSP;
    125           ENTER;
    126           SAVETMPS;
    127           PUSHMARK( sp);
    128           XPUSHs( ST(0) );
    129           PUTBACK;
    130           perl_call_method("_delete_subrefs", G_DISCARD);
    131           SPAGAIN;
    132           FREETMPS;
    133           LEAVE;
    134        }
    135        delete THIS;