Something like a smart pointer might be useful here. I thing that I also feel that the memory handling of the C++ objects might be the biggest issue here. What I think can happen is having Java objects *own* C++ objects and clean up in finalize() methods. Only a small idea though...
On Thu, Jun 4, 2015 at 8:23 PM, Branko Čibej <[email protected]> wrote: > On 04.06.2015 15:45, Vladimir Ozerov wrote: > > Igniters, > > > > Lots of our features rely on callbacks from Ignite to user code. This is > > essential for task execution, cache invokes, cache store, continuous > > queries, messaging, etc.. > > > > Ideally from user perspective target class should look somewhat like > this: > > class MyListener : public IListener<MyKey*, MyVal*> { > > public: > > bool Invoke(MyKey*, MyType*); > > } > > Please please please do not use raw pointers in the public API. This is > a memory management nightmare waiting to happen. Either use const > references or shared pointers. std::auto_ptr_ref is an option, but not a > very good one. > > -- Brane > > -- Regards, Atri *l'apprenant*
