Abdelrazak Younes wrote:
> Peter Kümmel wrote:
>>
>> Yes, this could be. We should simply NOT use the static solution.
>> Does attached patch work on Debian? If yes we could remove
>> BugfixSignal, and
>> create the signal at runtime. But we then have to clean up correctly.
> 
> Your solution will only work with the first instance...
> 
> Abdel.
> 

When there is no dialog, then there is nothing to hide:
Index: src/frontends/Dialogs.cpp
===================================================================
--- src/frontends/Dialogs.cpp   (revision 19081)
+++ src/frontends/Dialogs.cpp   (working copy)
@@ -37,7 +37,7 @@
        Signal & operator()() { return thesignal(); }
        Signal const & operator()() const { return thesignal(); }
 
-private:
+//private:
        Signal & thesignal() const
        {
                if (!signal_.get())
@@ -51,7 +51,7 @@
 
 namespace {
 
-BugfixSignal<boost::signal<void(string const &, Inset*)> > hideSignal;
+BugfixSignal<boost::signal<void(string const &, Inset*)> > *hideSignal = 0;
 
 }
 
@@ -62,16 +62,20 @@
        // destructed before the cut stack in CutAndPaste.cpp, and this method
        // is called from some inset destructor if the cut stack is not empty
        // on exit.
-       if (!quitting)
-               hideSignal()(name, inset);
+       if (!quitting && hideSignal) {
+               hideSignal->thesignal()(name, inset);
+       }
 }
 
 
 Dialogs::Dialogs(LyXView & lyxview)
        : lyxview_(lyxview), in_show_(false)
 {
+       if (!hideSignal) {
+               hideSignal = new BugfixSignal<boost::signal<void(string const 
&, Inset*)> >;
+       }
        // Connect signals
-       connection_ = hideSignal().connect(boost::bind(&Dialogs::hideSlot, 
this, _1, _2));
+       connection_ = 
hideSignal->thesignal().connect(boost::bind(&Dialogs::hideSlot, this, _1, _2));
 }
 
 Dialogs::~Dialogs() 

Reply via email to