Abdelrazak Younes wrote:
Bo Peng wrote:
I can't reproduce. I tried what you suggested in the report, but still
didn't get a crash. Can you post or send a minimal file?
OK. I have confirmed that this is our old signals + gcc 3 friend. When
I compile the program with gcc 4, the problem goes away. It should be
a missing disconnect somewhere, something similar to
http://marc.info/?l=lyx-devel&m=118056557300550&w=2
Abdel, you have worked on this boost signals thing a lot. Do you have
any idea what is going on here?
It seems like the same problem indeed. You need to disconnect the
connection created in GraphicsLoader.cpp:
Loader::connect(slot_type const & slot)
But I don't know where this connection is stored and if it is stored
actually.
It was not, I committed a fix. You should review all boost::signal used
in the code and do the same if you want to avoid further crashes.
Abdel.
Author: younes
Date: Wed Aug 15 17:13:22 2007
New Revision: 19591
URL: http://www.lyx.org/trac/changeset/19591
Log:
fix signal crash with gcc 3.
Modified:
lyx-devel/trunk/src/insets/RenderGraphic.cpp
lyx-devel/trunk/src/insets/RenderGraphic.h
Modified: lyx-devel/trunk/src/insets/RenderGraphic.cpp
URL:
http://www.lyx.org/trac/file/lyx-devel/trunk/src/insets/RenderGraphic.cpp?rev=19591
==============================================================================
--- lyx-devel/trunk/src/insets/RenderGraphic.cpp (original)
+++ lyx-devel/trunk/src/insets/RenderGraphic.cpp Wed Aug 15 17:13:22 2007
@@ -40,7 +40,7 @@
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 @@
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));
}
Modified: lyx-devel/trunk/src/insets/RenderGraphic.h
URL:
http://www.lyx.org/trac/file/lyx-devel/trunk/src/insets/RenderGraphic.h?rev=19591
==============================================================================
--- lyx-devel/trunk/src/insets/RenderGraphic.h (original)
+++ lyx-devel/trunk/src/insets/RenderGraphic.h Wed Aug 15 17:13:22 2007
@@ -17,6 +17,7 @@
#include "graphics/GraphicsLoader.h"
#include "graphics/GraphicsParams.h"
+#include <boost/signal.hpp>
namespace lyx {
@@ -27,6 +28,8 @@
RenderGraphic(Inset const *);
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;
@@ -46,6 +49,9 @@
/// The stored data.
graphics::Loader loader_;
graphics::Params params_;
+
+ //
+ boost::signals::connection loader_connection_;
};