diff -ru Search-Xapian-1.2.15.0.0/Xapian/QueryParser.pm Search-Xapian-1.2.15.0/Xapian/QueryParser.pm
old
|
new
|
|
34 | 34 | return $qp; |
35 | 35 | } |
36 | 36 | |
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 | | |
53 | 37 | 1; |
54 | 38 | |
55 | 39 | __END__ |
diff -ru Search-Xapian-1.2.15.0.0/XS/QueryParser.xs Search-Xapian-1.2.15.0/XS/QueryParser.xs
old
|
new
|
|
22 | 22 | THIS->set_stemming_strategy(static_cast<QueryParser::stem_strategy>(strategy)); |
23 | 23 | |
24 | 24 | void |
25 | | QueryParser::set_stopper0(stopper) |
| 25 | QueryParser::set_stopper(stopper) |
26 | 26 | Stopper * stopper |
27 | 27 | CODE: |
| 28 | // FIXME: no corresponding SvREFCNT_dec(), but a leak seems better than |
| 29 | // a SEGV! |
| 30 | SvREFCNT_inc(ST(1)); |
28 | 31 | THIS->set_stopper(stopper); |
29 | 32 | |
30 | 33 | void |
… |
… |
|
113 | 116 | QueryParser::get_description() |
114 | 117 | |
115 | 118 | void |
116 | | QueryParser::add_valuerangeprocessor0(ValueRangeProcessor * vrproc) |
| 119 | QueryParser::add_valuerangeprocessor(ValueRangeProcessor * vrproc) |
117 | 120 | CODE: |
| 121 | // FIXME: no corresponding SvREFCNT_dec(), but a leak seems better than |
| 122 | // a SEGV! |
| 123 | SvREFCNT_inc(ST(1)); |
118 | 124 | THIS->add_valuerangeprocessor(vrproc); |
119 | 125 | |
120 | 126 | void |
121 | 127 | QueryParser::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; |