Hi Alexander,

My application has own memory managing policy (references counting).

are the reference counts applied to the objects directly or through smart
pointers? And if the latter, are the smart pointers what you expose through
cppyy?

That's why I need to *catch* moment when pypy is deleting foreign C++
objects - all of it should be "released" before pypy exits.

Exposing smart pointers would do that, so would a common base class. Does
either one apply?

Can anybody advice a solution in my case? Some using of gc module or some
other?
Also I tried to change __del__ method of W_CPPInstance in
.../pypy/module/cppyy/interp_cppyy.py. Is it right way?

Depends on what you are trying to achieve there. Do you want to call a
global function from __del__?

What is the life time of the objects? It is also possible, if you just
want to call a global function, to not manage the lifetimes on the python
side, and explicitly call a cleanup from time to time? (You can manage
life times with _python_owns and call __destruct__ explicitly (PyPy2.3)
to destroy the C++-side only).

Best regards,
           Wim
--
wlavrij...@lbl.gov    --    +1 (510) 486 6411    --    www.lavrijsen.net
_______________________________________________
pypy-dev mailing list
pypy-dev@python.org
https://mail.python.org/mailman/listinfo/pypy-dev

Reply via email to