]> git.lyx.org Git - features.git/commitdiff
Avoid a crash on exit (Mac and Windows).
authorEnrico Forestieri <forenr@lyx.org>
Wed, 30 Apr 2008 18:23:46 +0000 (18:23 +0000)
committerEnrico Forestieri <forenr@lyx.org>
Wed, 30 Apr 2008 18:23:46 +0000 (18:23 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@24566 a592a061-630c-0410-9148-cb99ea01b6c8

src/frontends/qt4/GuiClipboard.cpp

index 7fb2a75b43c37367006e62da23ff5c6998533396..ce76d0fed3b9791c1986250208d771fe09f121a2 100644 (file)
@@ -170,7 +170,7 @@ QVector<FORMATETC> QWindowsMimeMetafile::formatsForMime(
        return formats;
 }
 
-static std::auto_ptr<QWindowsMimeMetafile> metafileWindowsMime;
+static QWindowsMimeMetafile * metafileWindowsMime;
 
 #endif // Q_WS_WIN
 
@@ -235,7 +235,7 @@ QList<QByteArray> QMacPasteboardMimeGraphics::convertFromMime(QString const & mi
        return ret;
 }
 
-static std::auto_ptr<QMacPasteboardMimeGraphics> graphicsPasteboardMime;
+static QMacPasteboardMimeGraphics * graphicsPasteboardMime;
 
 #endif // Q_WS_MACX
 
@@ -248,21 +248,31 @@ GuiClipboard::GuiClipboard()
        on_dataChanged();
        
 #ifdef Q_WS_MACX
-       if (!graphicsPasteboardMime.get())
-               graphicsPasteboardMime.reset(new QMacPasteboardMimeGraphics());
+       if (!graphicsPasteboardMime)
+               graphicsPasteboardMime = new QMacPasteboardMimeGraphics();
 #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();
+       if (graphicsPasteboardMime) {
+               delete graphicsPasteboardMime;
+               graphicsPasteboardMime = 0;
+       }
 #endif // Q_WS_MACX
 }