Skip to content

Commit

Permalink
fix unmapped wxArrayString* out arg
Browse files Browse the repository at this point in the history
  • Loading branch information
mcorino committed Sep 18, 2023
1 parent 61b7c68 commit 0aac22c
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions rakelib/lib/director/pgproperty.rb
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,35 @@ def setup
return (*self)[idx];
}
__HEREDOC
# for GetIndicesForStrings
spec.map 'wxArrayString *unmatched' => 'Array,nil' do

map_in temp: 'wxArrayString tmp, VALUE rb_unmatched', code: <<~__CODE
rb_unmatched = $input;
if (!NIL_P(rb_unmatched))
{
if (TYPE(rb_unmatched) == T_ARRAY)
{
$1 = &tmp;
}
else
{
SWIG_exception_fail(SWIG_TypeError, Ruby_Format_TypeError( "", "Array", "GetIndicesForStrings", $argnum, $input ));
}
}
__CODE

map_argout by_ref: true, code: <<~__CODE
if (!NIL_P(rb_unmatched$argnum))
{
for (size_t i = 0; i < $1->GetCount(); i++)
{
rb_ary_push(rb_unmatched$argnum,WXSTR_TO_RSTR( $1->Item(i) ) );
}
}
__CODE

end
spec.disown 'wxPGProperty *prop', 'wxPGProperty *childProperty'
# do not think this useful for wxRuby (Also; caused GC problems)
spec.ignore 'wxPGProperty::GetCellRenderer'
Expand Down

0 comments on commit 0aac22c

Please sign in to comment.