Georg Baum wrote:
> Peter Kümmel wrote:
> 
>> Georg Baum wrote:
>>> Peter Kümmel wrote:
>>>
>>>> I think the reason for the crash is :
>>>>
>>>> lyx-qt3.exe!`anonymous namespace'::`dynamic atexit destructor for
>>>> 'theCuts''()  + 0xd bytes     C++ msvcr80d.dll!102020c6()
>>>> lyx-qt3.exe!LyXServer::`scalar deleting destructor'()  + 0x27 bytes  
>>>> C++ msvcr80d.dll!10201e00()
>>>> lyx-qt3.exe!lyx_gui::exit(int status=0)  Line 281 + 0xc bytes C++
>>>> lyx-qt3.exe!QuitLyX(bool noask=false)  Line 220 + 0x7 bytes   C++
>>>>
>>>>
>>>> the free variable theCuts, it is destructed first, and I assume the
>>>> values are later on used.
>>> I don't think so. The backtrace tells about a problem in the destructor,
>>> not in using theCuts. If theCuts would be used after destruction, then
>>> the destructor would not occur in the backtrace, but the code using
>>> theCuts afterwards, no?
>>>
>> above backtrace was not complete, it only shows the destruction of theCuts
>> the more complete is here:
>>
>>
> http://www.mail-archive.com/lyx-devel@lists.lyx.org/msg101523.html
> 
> Still I don't see how the problem could be in code using theCuts after
> destruction. It rather looks like something going wrong in destructors
> called from ~CutStack().

Yes, I've verified that it crashes while destructing theCut, and not
after this destruction.

> I think that the attached patch should fix the problem.

Will test it.

>> Nevertheless static (global) variables only make problems.
> 
> That is exagerrated,but  I agree that they should be avoided if possible.
> 
> 
> Georg
> 
> 
> ------------------------------------------------------------------------
> 
> Index: src/frontends/Dialogs.C
> ===================================================================
> --- src/frontends/Dialogs.C   (Revision 15111)
> +++ src/frontends/Dialogs.C   (Arbeitskopie)
> @@ -73,6 +73,14 @@ Dialogs::Dialogs(LyXView & lyxview)
>  }
>  
>  
> +Dialogs::~Dialogs()
> +{
> +     // Disconnect signals
> +     redrawGUI().disconnect_all_slots();
> +     hideSignal().disconnect_all_slots();
> +}
> +
> +
>  Dialog * Dialogs::find_or_build(string const & name)
>  {
>       if (!isValidName(name))
> Index: src/frontends/Dialogs.h
> ===================================================================
> --- src/frontends/Dialogs.h   (Revision 15111)
> +++ src/frontends/Dialogs.h   (Arbeitskopie)
> @@ -33,6 +33,8 @@ class Dialogs : boost::noncopyable {
>  public:
>       ///
>       Dialogs(LyXView &);
> +     ///
> +     ~Dialogs();
>  
>       /** Redraw all visible dialogs because, for example, the GUI colours
>        *  have been re-mapped.

Ahh..., means nearly recompile all.

-- 
Peter Kümmel

Reply via email to