From: Peter Kümmel Date: Sat, 19 Apr 2008 09:36:19 +0000 (+0000) Subject: fix memory leak, using boost::shared_ptr because std::auto_ptr as no value semantic X-Git-Tag: 1.6.10~5119 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=1833d310afa6775933e7589890b5a40ce4ffaac9;p=features.git fix memory leak, using boost::shared_ptr because std::auto_ptr as no value semantic git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@24344 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/frontends/qt4/GuiClipboard.cpp b/src/frontends/qt4/GuiClipboard.cpp index 839bd02129..a7b1e307b7 100644 --- a/src/frontends/qt4/GuiClipboard.cpp +++ b/src/frontends/qt4/GuiClipboard.cpp @@ -53,6 +53,8 @@ #include #endif // Q_WS_WIN +#include + #include using namespace std; @@ -169,7 +171,7 @@ QVector QWindowsMimeMetafile::formatsForMime( return formats; } -static QWindowsMimeMetafile * metafileWindowsMime; +static boost::shared_ptr metafileWindowsMime; #endif // Q_WS_WIN @@ -234,7 +236,7 @@ QList QMacPasteboardMimeGraphics::convertFromMime(QString const & mi return ret; } -static QMacPasteboardMimeGraphics * graphicsPasteboardMime; +static boost::shared_ptr graphicsPasteboardMime; #endif // Q_WS_MACX @@ -248,12 +250,16 @@ GuiClipboard::GuiClipboard() #ifdef Q_WS_MACX if (!graphicsPasteboardMime) - graphicsPasteboardMime = new QMacPasteboardMimeGraphics(); + graphicsPasteboardMime = + boost::shared_ptr + (new QMacPasteboardMimeGraphics()); #endif // Q_WS_MACX #ifdef Q_WS_WIN if (!metafileWindowsMime) - metafileWindowsMime = new QWindowsMimeMetafile(); + metafileWindowsMime = + boost::shared_ptr + (new QWindowsMimeMetafile()); #endif // Q_WS_WIN }