Swig and Memory Leaks

[email protected] (Alberto Simões)
Newsgroups perl.xs
Organization Departamento de Informática - Universi dade do Minho
Message-ID <[email protected]>
Hello,

Anybody with experience with Swig?
Does it usually takes care on freeing unused variables?

Packages generated by Swig include a DESTROY method:

 >  sub DESTROY {
 >    return unless $_[0]->isa('HASH');
 >    my $self = tied(%{$_[0]});
 >    return unless defined $self;
 >    delete $ITERATORS{$self};
 >    if (exists $OWNER{$self}) {
 >        Lingua::FreeLing3::Bindingsc::delete_word($self);
 >        delete $OWNER{$self};
 >    }
 > }

But I am not able to understand this completely.
I can say that the detele_word(...) method exists, and that it seems to 
delete the used memory.
But not easy to understand if/when it is called.

Thanks for any hint/pointer

Cheers
ambs
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.