Image::ImagePtr image_;
/// This signal is emitted when the image loading status changes.
boost::signal<void()> signal_;
+ /// The connection of the signal StatusChanged
+ boost::signals::connection sc_;
private:
///
if (!old_file.empty()) {
continue_monitoring = cached_item_->monitoring();
+ // cached_item_ is going to be reset, so the connected
+ // signal needs to be disconnected.
+ sc_.disconnect();
cached_item_.reset();
Cache::get().remove(old_file);
}
if (continue_monitoring && !cached_item_->monitoring())
cached_item_->startMonitoring();
- cached_item_->connect(boost::bind(&Impl::statusChanged, this));
+ sc_ = cached_item_->connect(boost::bind(&Impl::statusChanged, this));
}
RenderGraphic::RenderGraphic(Inset const * inset)
{
- loader_connection_ = loader_.connect(boost::bind(&LyX::updateInset,
+ loader_.connect(boost::bind(&LyX::updateInset,
boost::cref(LyX::cref()), inset));
}
loader_(other.loader_),
params_(other.params_)
{
- loader_connection_ = loader_.connect(boost::bind(&LyX::updateInset,
+ loader_.connect(boost::bind(&LyX::updateInset,
boost::cref(LyX::cref()), inset));
}
#include "graphics/GraphicsLoader.h"
#include "graphics/GraphicsParams.h"
-#include <boost/signal.hpp>
namespace lyx {
RenderGraphic(RenderGraphic const &, Inset const *);
std::auto_ptr<RenderBase> clone(Inset const *) const;
- ~RenderGraphic() { loader_connection_.disconnect(); }
-
/// compute the size of the object returned in dim
bool metrics(MetricsInfo & mi, Dimension & dim) const;
/// draw inset
/// The stored data.
graphics::Loader loader_;
graphics::Params params_;
-
- //
- boost::signals::connection loader_connection_;
};