Hello
I get crashes in the destructor of Ndb depending a bit on how I declare
variables in perl. I think perl doesn't have a deterministic destruction
order by declaration order (since it does have reference counting). This
means that calls like
my $myNdb = new mysql::cluster::ndbapi::Ndb($connection, "mq_cluster");
should increment the refcount of the perl-side $connection and deletion
of the $myNdb should decrease the count.
I'm not sure if there is a real way of doing this in SWIG, not at least
without writing quite a lot of code. It would need something like:
* add a new typemap for input parameters that should be addref'ed
* write the addref code for each target language
* wrap deletion of Ndb objects to decrease the native refcount of the
connection
* write the decref code for each target language
The other option is to have a target-language side module that takes
care of extending the lifetime of the connection over the lifetime of
the Ndb.
Mika