On Tue, Apr 29, 2008 at 04:35:00PM +0200, Enrico Forestieri wrote:
> On both mingw and cygwin, LyX crashes on exit. This is due to a doubly
> destroyed object and I wonder why others don't see this with MSVC.

I fail to see the double deletion.

> ===================================================================
> --- src/frontends/qt4/GuiClipboard.cpp        (revision 24551)
> +++ src/frontends/qt4/GuiClipboard.cpp        (working copy)
> @@ -170,7 +170,7 @@ QVector<FORMATETC> QWindowsMimeMetafile:
>       return formats;
>  }
>  
> -static std::auto_ptr<QWindowsMimeMetafile> metafileWindowsMime;
> +static QWindowsMimeMetafile * metafileWindowsMime;
>  
>  #endif // Q_WS_WIN
>  
> @@ -253,14 +253,20 @@ GuiClipboard::GuiClipboard()
>  #endif // Q_WS_MACX
>  
>  #ifdef Q_WS_WIN
> -     if (!metafileWindowsMime.get())
> -             metafileWindowsMime.reset(new QWindowsMimeMetafile());
> +     if (!metafileWindowsMime)
> +             metafileWindowsMime = new QWindowsMimeMetafile();
>  #endif // Q_WS_WIN
>  }
>  
>  
>  GuiClipboard::~GuiClipboard()
>  {
> +#ifdef Q_WS_WIN
> +     if (metafileWindowsMime) {
> +             delete metafileWindowsMime;
> +             metafileWindowsMime = 0;
> +     }
> +#endif // Q_WS_WIN
>  #ifdef Q_WS_MACX
>       closeAllLinkBackLinks();
>  #endif // Q_WS_MACX

There's the destructor of the auto_ptr<>. And what else?

Andre'

Reply via email to