Re: Custom TreeModel



Emmanuel Rodriguez <emmanuel rodriguez gmail com> writes:

    return [ $self->{stamp}, 0, $node, undef ];  # Crash latter on

I think that's supposed to work, provided $node is kept alive by the
model (ie. isn't a copy or something).

If I try to pass to path to the node (XPath expression as a string), I
receive undef.
    return [ $self->{stamp}, 0, $node->nodePath, undef ]; # The string is
lost in the next calls

I've got an idea non-refs in those last two slots are silently discarded
(iter_from_sv() in GtkTreeModel.xs), which is a trap for the unwary.

    return [ $self->{stamp}, 0, [ $xpath ], undef ];
# Next calls receive [0,0,\$VAR1->[1],undef];

Oh, I think that anon array may be garbage collected immediately, as the
iter doesn't hold a reference to it, making any access including a print
probably not work.



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]