Andre Poenitz wrote:
Why don't the stored menus simply get a QObject parent?
Any idea to remove here shared_ptr? -- Peter Kümmel
Index: frontends/qt4/GuiClipboard.cpp =================================================================== --- frontends/qt4/GuiClipboard.cpp (revision 24298) +++ frontends/qt4/GuiClipboard.cpp (working copy) @@ -53,6 +53,8 @@ #include <objidl.h> #endif // Q_WS_WIN +#include <boost/shared_ptr.hpp> + #include <map> using namespace std; @@ -169,7 +171,7 @@ return formats; } -static QWindowsMimeMetafile * metafileWindowsMime; +static boost::shared_ptr<QWindowsMimeMetafile> metafileWindowsMime; #endif // Q_WS_WIN @@ -234,7 +236,7 @@ return ret; } -static QMacPasteboardMimeGraphics * graphicsPasteboardMime; +static boost::shared_ptr<QMacPasteboardMimeGraphics> graphicsPasteboardMime; #endif // Q_WS_MACX @@ -248,12 +250,16 @@ #ifdef Q_WS_MACX if (!graphicsPasteboardMime) - graphicsPasteboardMime = new QMacPasteboardMimeGraphics(); + graphicsPasteboardMime = + boost::shared_ptr<QMacPasteboardMimeGraphics> + (new QMacPasteboardMimeGraphics()); #endif // Q_WS_MACX #ifdef Q_WS_WIN if (!metafileWindowsMime) - metafileWindowsMime = new QWindowsMimeMetafile(); + metafileWindowsMime = + boost::shared_ptr<QWindowsMimeMetafile> + (new QWindowsMimeMetafile()); #endif // Q_WS_WIN }