> 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?

Bo
Index: src/graphics/GraphicsCacheItem.cpp
===================================================================
--- src/graphics/GraphicsCacheItem.cpp	(revision 19591)
+++ src/graphics/GraphicsCacheItem.cpp	(working copy)
@@ -51,6 +51,12 @@
 	///
 	Impl(FileName const & file);
 
+	~Impl()
+	{
+		if (sc_.connected())
+			sc_.disconnect();
+	}
+	
 	/** Start the image conversion process, checking first that it is
 	 *  necessary. If it is necessary, then a conversion task is started.
 	 *  CacheItem asumes that the conversion is asynchronous and so
@@ -131,6 +137,9 @@
 
 	/// The connection of the signal ConvProcess::finishedConversion,
 	boost::signals::connection cc_;
+	
+	/// The connection of the signal StatusChanged
+	boost::signals::connection sc_;	
 
 	///
 	boost::scoped_ptr<Converter> converter_;
@@ -191,7 +200,7 @@
 
 boost::signals::connection CacheItem::connect(slot_type const & slot) const
 {
-	return pimpl_->statusChanged.connect(slot);
+	return pimpl_ -> sc_ = pimpl_->statusChanged.connect(slot);
 }
 
 

Reply via email to