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 }