]> git.lyx.org Git - features.git/commitdiff
fix signal crash with gcc 3.
authorAbdelrazak Younes <younes@lyx.org>
Wed, 15 Aug 2007 15:13:22 +0000 (15:13 +0000)
committerAbdelrazak Younes <younes@lyx.org>
Wed, 15 Aug 2007 15:13:22 +0000 (15:13 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19591 a592a061-630c-0410-9148-cb99ea01b6c8

src/insets/RenderGraphic.cpp
src/insets/RenderGraphic.h

index 3e9232edf23c14320727eb95e300184edc375c10..f8e0d2407556d98a0f7a0ac6f405e57949000ae0 100644 (file)
@@ -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));
 }
 
index 49db0e2c1f8d6b227f599b408e50beb7c5129ed0..7bbb87496c852fafae5f15f290085e7c7ee53a80 100644 (file)
@@ -17,6 +17,7 @@
 #include "graphics/GraphicsLoader.h"
 #include "graphics/GraphicsParams.h"
 
+#include <boost/signal.hpp>
 
 namespace lyx {
 
@@ -28,6 +29,8 @@ public:
        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
@@ -46,6 +49,9 @@ private:
        /// The stored data.
        graphics::Loader loader_;
        graphics::Params params_;
+
+       //
+       boost::signals::connection loader_connection_;
 };