]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/Dialogs.C
hopefully fix tex2lyx linking.
[lyx.git] / src / frontends / Dialogs.C
index 2a532f70bee4b46a2c94001e58ca62118dd5aab9..d09b59120dae7e4c434663cc037182c3870a2777 100644 (file)
 
 #include "Dialogs.h"
 
+#include "lyx_cb.h"
+
 #include "controllers/Dialog.h"
 
 #include <boost/signal.hpp>
 #include <boost/bind.hpp>
 
 
+namespace lyx {
+
+
 using std::string;
 using lyx::frontend::Dialog;
 
@@ -53,7 +58,12 @@ BugfixSignal<boost::signal<void(string const &, InsetBase*)> > hideSignal;
 
 void Dialogs::hide(string const & name, InsetBase* inset)
 {
-       hideSignal()(name, inset);
+       // Don't send the signal if we are quitting, because on MSVC it is
+       // destructed before the cut stack in CutAndPaste.C, and this method
+       // is called from some inset destructor if the cut stack is not empty
+       // on exit.
+       if (!quitting)
+               hideSignal()(name, inset);
 }
 
 
@@ -157,7 +167,8 @@ void Dialogs::disconnect(string const & name)
        if (!isValidName(name))
                return;
 
-       open_insets_[name] = 0;
+       if (open_insets_.find(name) != open_insets_.end())
+               open_insets_[name] = 0;
 }
 
 
@@ -237,3 +248,6 @@ void Dialogs::checkStatus()
                        dialog->checkStatus();
        }
 }
+
+
+} // namespace lyx