Bo Peng wrote:
The best solution actually is to store
the signal connection inside CacheItem actually. So neither your patch
nor mine is correct.

I have told you that the attached patch does not work (and ~Impl() is
not called). Am I missing something?

Ah? Sorry, I missed that one. Try this one then.

Abdel.
Index: GraphicsCacheItem.cpp
===================================================================
--- GraphicsCacheItem.cpp       (revision 19589)
+++ GraphicsCacheItem.cpp       (working copy)
@@ -131,6 +131,9 @@
 
        /// The connection of the signal ConvProcess::finishedConversion,
        boost::signals::connection cc_;
+       
+       ///
+       boost::signals::connection statusChanged_connection_;
 
        ///
        boost::scoped_ptr<Converter> converter_;
@@ -191,7 +194,9 @@
 
 boost::signals::connection CacheItem::connect(slot_type const & slot) const
 {
-       return pimpl_->statusChanged.connect(slot);
+       pimpl_->statusChanged_connection_.disconnect();
+       pimpl_->statusChanged_connection_ = pimpl_->statusChanged.connect(slot);
+       return pimpl_->statusChanged_connection_;
 }
 
 

Reply via email to