title: Tracking down owner of a shared_ptr?
body: <p>In our app we're about to (finally..) switch from raw pointers to using C++11 <code>smart_ptr</code> templates.</p>
  
  <p>We do have the occasional bug in our app with (non C++) objects still keeping references to our C++ objects causing crashes in the past when accessing the then-dealloc'd objects.</p>
  
  <p>Not sure if this is a silly question - but is there a way to take advantage of the <code>smart_ptr</code> objects and '<em>dump</em>' the objects still holding on to the C++ objects when none are expected to hold a reference to one any more?</p>
  
  <p>I guess what I'm asking for is <strong>a way to list all owners of <code>smart_ptr&lt;MyClass&gt;</code></strong> at a certain point in time.</p>
  
  <p>Any suggestions much appreciated!</p>