Boost logo

Boost Users :

Subject: [Boost-users] shared_ptr + bind, is it ok?
From: Matheus Araújo Aguiar (matheus.pit_at_[hidden])
Date: 2010-06-09 20:58:26


Hello list,

In my application i am using a shared_ptr to manage the lifetime of some
important objects. Lately i've been noticing that they are not being
destroyed (their destructor is never called) and their use count is 9.
I've started debugging and noticed that if i pass the shared_ptr to
boost::bind as a parameter when the binded function is executed the
use_count is greater than what would be expected (in my particular case 4
instead of one). As i make use of boost::bind, the shared_ptr reaches a
point where its use_count is way out of expectations, getting to 9.
So is this expected? Am i incorrectly using boost::bind or shared_ptr in
this situation?

Sorry not giving more detailed info or code, for now this is the info i can
give.

Thank you all for your time,

-- 
Matheus Araújo Aguiar
Computer Scientist
matheus.pit_at_[hidden]


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net