Fix crash with multiple windows: Disconnect the Dialog::hideSlot signal for a deleted Dialog instance.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18684 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Bernhard Roider 2007-06-05 19:02:06 +00:00
parent 8aa6a50e69
commit 90f2bbe012
2 changed files with 10 additions and 1 deletions

View File

@ -71,9 +71,13 @@ Dialogs::Dialogs(LyXView & lyxview)
: lyxview_(lyxview), in_show_(false)
{
// Connect signals
hideSignal().connect(boost::bind(&Dialogs::hideSlot, this, _1, _2));
connection_ = hideSignal().connect(boost::bind(&Dialogs::hideSlot, this, _1, _2));
}
Dialogs::~Dialogs()
{
connection_.disconnect();
}
Dialog * Dialogs::find_or_build(string const & name)
{

View File

@ -31,6 +31,8 @@ class Dialogs : boost::noncopyable {
public:
///
Dialogs(LyXView &);
///
~Dialogs();
/** Check the status of all visible dialogs and disable or reenable
* them as appropriate.
@ -116,6 +118,9 @@ private:
/// flag against a race condition due to multiclicks in Qt frontend, see bug #1119
bool in_show_;
///
boost::signals::connection connection_;
};
} // namespace lyx