List:NDB Connectors« Previous MessageNext Message »
From:Mika Raento Date:May 8 2007 8:58am
Subject:Re: [Fwd: Re: [Swig-user] C++ wrapping question]
View as plain text  
So the following added to the top of perl_extend_ndbtransaction_async.i 
extends the lifetime of the transaction to cover the callback:

%feature("shadow") executeAsynchPrepare(ExecType          execType,
                             SV*                 pFcn,
                             AbortOption       abortOption = AbortOnError)
%{
     sub executeAsynchPrepare {
         my $self=shift;
         my $exec=shift;
         my $sub=shift;
         my $abort=shift;
 
mysql::cluster::ndbapic::NdbTransaction_executeAsynchPrepare($self, $exec,
             sub { $sub->(); $self; }, $abort);
     }
%}


(the crucial bit being the $self; added to the anon sub).

    Mika
Thread
[Fwd: Re: [Swig-user] C++ wrapping question]Monty Taylor7 May
  • Re: [Fwd: Re: [Swig-user] C++ wrapping question]Mika Raento8 May
    • Re: [Fwd: Re: [Swig-user] C++ wrapping question]Monty Taylor8 May
      • Re: [Fwd: Re: [Swig-user] C++ wrapping question]Mika Raento8 May
        • Re: [Fwd: Re: [Swig-user] C++ wrapping question]Monty Taylor8 May
          • Re: [Fwd: Re: [Swig-user] C++ wrapping question]Mika Raento8 May
            • Re: [Fwd: Re: [Swig-user] C++ wrapping question]Mika Raento8 May
              • Re: [Fwd: Re: [Swig-user] C++ wrapping question]Mika Raento8 May
          • compilation fails from bzrMika Raento8 May
            • Re: compilation fails from bzrMonty Taylor8 May