[Xapian-tickets] [Xapian] #714: Use C++ API optional reference counting in bindings

Xapian nobody at xapian.org
Tue Jun 7 07:16:45 BST 2022


#714: Use C++ API optional reference counting in bindings
-----------------------------+-------------------------------
 Reporter:  Olly Betts       |             Owner:  Olly Betts
     Type:  defect           |            Status:  new
 Priority:  normal           |         Milestone:  1.4.x
Component:  Xapian-bindings  |           Version:  git master
 Severity:  normal           |        Resolution:
 Keywords:                   |        Blocked By:
 Blocking:                   |  Operating System:  All
-----------------------------+-------------------------------
Comment (by Olly Betts):

 I've hit on this approach, which seems to work in tests with PHP so far,
 and can be neatly wrapped up in a macro (perhaps just done by the existing
 `SUBCLASSABLE` macro):

 {{{
 %typemap(in) (Xapian::FieldProcessor* proc) %{
 $typemap(in, Xapian::FieldProcessor* DISOWN)
 {
   Swig::Director* xapian_swig_director =
 dynamic_cast<Swig::Director*>($1);
   if (xapian_swig_director) xapian_swig_director->swig_disown();
 }
 $1->release();
 %}
 }}}

 I'm not actually sure if the special handling for director classes is
 needed.
-- 
Ticket URL: <https://trac.xapian.org/ticket/714#comment:1>
Xapian <https://xapian.org/>
Xapian


More information about the Xapian-tickets mailing list