From bf33e3486930c4297b82d28a61d808de3b0362bf Mon Sep 17 00:00:00 2001 From: Abdelrazak Younes Date: Wed, 15 Aug 2007 15:13:22 +0000 Subject: [PATCH] fix signal crash with gcc 3. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19591 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/insets/RenderGraphic.cpp | 4 ++-- src/insets/RenderGraphic.h | 6 ++++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/insets/RenderGraphic.cpp b/src/insets/RenderGraphic.cpp index 3e9232edf2..f8e0d24075 100644 --- a/src/insets/RenderGraphic.cpp +++ b/src/insets/RenderGraphic.cpp @@ -40,7 +40,7 @@ using std::auto_ptr; RenderGraphic::RenderGraphic(Inset const * inset) { - loader_.connect(boost::bind(&LyX::updateInset, + loader_connection_ = loader_.connect(boost::bind(&LyX::updateInset, boost::cref(LyX::cref()), inset)); } @@ -51,7 +51,7 @@ RenderGraphic::RenderGraphic(RenderGraphic const & other, loader_(other.loader_), params_(other.params_) { - loader_.connect(boost::bind(&LyX::updateInset, + loader_connection_ = loader_.connect(boost::bind(&LyX::updateInset, boost::cref(LyX::cref()), inset)); } diff --git a/src/insets/RenderGraphic.h b/src/insets/RenderGraphic.h index 49db0e2c1f..7bbb87496c 100644 --- a/src/insets/RenderGraphic.h +++ b/src/insets/RenderGraphic.h @@ -17,6 +17,7 @@ #include "graphics/GraphicsLoader.h" #include "graphics/GraphicsParams.h" +#include namespace lyx { @@ -28,6 +29,8 @@ public: RenderGraphic(RenderGraphic const &, Inset const *); std::auto_ptr 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 @@ -46,6 +49,9 @@ private: /// The stored data. graphics::Loader loader_; graphics::Params params_; + + // + boost::signals::connection loader_connection_; }; -- 2.39.5