Bo Peng wrote:
If I read correctly your patch, it is a problem of non disconnected
signal so it is related. When you reset the smart pointer, you will in
effect call the destructor.
As far as I can tell, the destructor of CacheItem is *not* called when
cache_item_.reset() is called.
Of course it is called. Cache::ItemPtr _is_ a smart pointer:
typedef boost::shared_ptr<CacheItem> ItemPtr;
So calling cache_item_.reset() will for sure destroy the internal CacheItem.
When I save sc_ and disconnect sc_ in
CacheItem::Impl, the crash persists.
I know that but that's just another manifestation of the same bug: any
place where a CacheItem is used, the signal connection should be stored
and disconnect at destruction. The best solution actually is to store
the signal connection inside CacheItem actually. So neither your patch
nor mine is correct.
Abdel.