]> git.lyx.org Git - lyx.git/commitdiff
Fix crash with multiple windows: Disconnect the Dialog::hideSlot signal for a deleted...
authorBernhard Roider <bernhard.roider@sonnenkinder.org>
Tue, 5 Jun 2007 19:02:06 +0000 (19:02 +0000)
committerBernhard Roider <bernhard.roider@sonnenkinder.org>
Tue, 5 Jun 2007 19:02:06 +0000 (19:02 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18684 a592a061-630c-0410-9148-cb99ea01b6c8

src/frontends/Dialogs.cpp
src/frontends/Dialogs.h

index 35d4e013d72574b089c637e4a79b656ccaa5f44d..a95950c7849126cb24238738bcf8b26a5923e079 100644 (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)
 {
index 323deee995ccad3ad703a37f8c88db883325afee..a81b7536a7a51249f351db110d5ffd5095bb48e9 100644 (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