[C++-sig] Retaining a useful weak_ptr to a wrapped C++ interface implemented in Python

Adam Preble adam.preble at gmail.com
Tue Mar 6 17:43:50 CET 2012


Do have a way to unregister the callback?  When I was using a shared_ptr
originally, I was trying to use that, yet the objects still hung around.  I
was thinking that I properly didn't completely unregister it from all
listeners, but I wonder now if I actually managed to cover all my tracks.
 I'm working through some unit tests goofs from my most recent refactoring
related to all this, so I can't reliably test this out.  When I get the
whole thing working together again, I'm thinking of trying again with some
callbacks and seeing that the objects in the shared pointers are getting
destroyed.

On Tue, Mar 6, 2012 at 9:46 AM, Holger Brandsmeier <brandsmeier at gmx.de>wrote:

> If you are storing the result as a shared_ptr in the problem, then you
> will not run into problem, that is what I am doing at the moment. This
> implies that my class never gets deleted, which I can accept at the
> moment, but its actually quite bad.
>
> Maybe someone else on the list has a solution for this. At the moment
> I can only explain what I believe is causing the error.
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/cplusplus-sig/attachments/20120306/467e7652/attachment.html>


More information about the Cplusplus-sig mailing list