Index: /trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMultiScreenLayout.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMultiScreenLayout.cpp	(revision 44832)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMultiScreenLayout.cpp	(revision 44833)
@@ -21,5 +21,4 @@
 #include <QApplication>
 #include <QDesktopWidget>
-#include <QMap>
 #include <QMenu>
 
@@ -41,5 +40,4 @@
 UIMultiScreenLayout::UIMultiScreenLayout(UIMachineLogic *pMachineLogic)
     : m_pMachineLogic(pMachineLogic)
-    , m_pScreenMap(new QMap<int, int>())
     , m_pViewMenu(0)
 {
@@ -51,6 +49,4 @@
 UIMultiScreenLayout::~UIMultiScreenLayout()
 {
-    /* Cleanup screen-map: */
-    delete m_pScreenMap;
     /* Cleanup view-menu: */
     cleanupViewMenu();
@@ -85,5 +81,5 @@
         if (!(   fOk /* Valid data */
               && cScreen >= 0 && cScreen < m_cHostScreens /* In the host screen bounds? */
-              && m_pScreenMap->key(cScreen, -1) == -1)) /* Not taken already? */
+              && m_screenMap.key(cScreen, -1) == -1)) /* Not taken already? */
         {
             /* If not, check the position of the guest window in normal mode.
@@ -105,5 +101,5 @@
                       && fOk2 /* Valid data */
                       && cScreen >= 0 && cScreen < m_cHostScreens /* In the host screen bounds? */
-                      && m_pScreenMap->key(cScreen, -1) == -1)) /* Not taken already? */
+                      && m_screenMap.key(cScreen, -1) == -1)) /* Not taken already? */
                     /* If not, simply pick the next one of the still available
                      * host screens. */
@@ -115,5 +111,5 @@
                 cScreen = availableScreens.first();
         }
-        m_pScreenMap->insert(i, cScreen);
+        m_screenMap.insert(i, cScreen);
         /* Remove the just selected screen from the list of available screens. */
         availableScreens.removeOne(cScreen);
@@ -136,10 +132,10 @@
 int UIMultiScreenLayout::hostScreenForGuestScreen(int iScreenId) const
 {
-    return m_pScreenMap->value(iScreenId, 0);
+    return m_screenMap.value(iScreenId, 0);
 }
 
 quint64 UIMultiScreenLayout::memoryRequirements() const
 {
-    return memoryRequirements(m_pScreenMap);
+    return memoryRequirements(m_screenMap);
 }
 
@@ -153,7 +149,7 @@
      * is present. */
     QDesktopWidget *pDW = QApplication::desktop();
-    for (int i = 0; i < m_pScreenMap->size(); ++i)
-    {
-        int hostScreen = m_pScreenMap->value(i);
+    for (int i = 0; i < m_screenMap.size(); ++i)
+    {
+        int hostScreen = m_screenMap.value(i);
         if (pDW->availableGeometry(hostScreen) != pDW->screenGeometry(hostScreen))
             return true;
@@ -169,12 +165,12 @@
 
     CMachine machine = m_pMachineLogic->session().GetMachine();
-    QMap<int,int> *pTmpMap = new QMap<int,int>(*m_pScreenMap);
+    QMap<int,int> tmpMap(m_screenMap);
     /* Search for the virtual screen which is currently displayed on the
      * requested host screen. When there is one found, we swap both. */
-    int r = pTmpMap->key(cHostScreen, -1);
+    int r = tmpMap.key(cHostScreen, -1);
     if (r != -1)
-        pTmpMap->insert(r, pTmpMap->value(cGuestScreen));
+        tmpMap.insert(r, tmpMap.value(cGuestScreen));
     /* Set the new host screen */
-    pTmpMap->insert(cGuestScreen, cHostScreen);
+    tmpMap.insert(cGuestScreen, cHostScreen);
 
     bool fSuccess = true;
@@ -184,5 +180,5 @@
             * _1M /* MiB to bytes */
             * 8; /* to bits */
-        quint64 usedBits = memoryRequirements(pTmpMap);
+        quint64 usedBits = memoryRequirements(tmpMap);
 
         fSuccess = availBits >= usedBits;
@@ -200,6 +196,5 @@
     {
         /* Swap the temporary with the previous map. */
-        delete m_pScreenMap;
-        m_pScreenMap = pTmpMap;
+        m_screenMap = tmpMap;
     }
 
@@ -281,5 +276,5 @@
     for (int i = 0; i < viewActions.size(); ++i)
     {
-        int iHostScreen = m_pScreenMap->value(i);
+        int iHostScreen = m_screenMap.value(i);
         if (fWithSave)
             machine.SetExtraData(QString("%1%2").arg(GUI_VirtualScreenToHostScreen).arg(i), QString::number(iHostScreen));
@@ -296,5 +291,5 @@
 }
 
-quint64 UIMultiScreenLayout::memoryRequirements(const QMap<int, int> *pScreenLayout) const
+quint64 UIMultiScreenLayout::memoryRequirements(const QMap<int, int> &screenLayout) const
 {
     ULONG width = 0;
@@ -307,7 +302,7 @@
         QRect screen;
         if (m_pMachineLogic->visualStateType() == UIVisualStateType_Seamless)
-            screen = QApplication::desktop()->availableGeometry(pScreenLayout->value(i, 0));
+            screen = QApplication::desktop()->availableGeometry(screenLayout.value(i, 0));
         else
-            screen = QApplication::desktop()->screenGeometry(pScreenLayout->value(i, 0));
+            screen = QApplication::desktop()->screenGeometry(screenLayout.value(i, 0));
         display.GetScreenResolution(i, width, height, guestBpp);
         usedBits += screen.width() * /* display width */
Index: /trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMultiScreenLayout.h
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMultiScreenLayout.h	(revision 44832)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMultiScreenLayout.h	(revision 44833)
@@ -22,4 +22,5 @@
 /* Qt includes: */
 #include <QObject>
+#include <QMap>
 
 /* Forward declarations: */
@@ -27,5 +28,4 @@
 class QMenu;
 class QAction;
-template <class Key, class T> class QMap;
 
 /* Multi-screen layout manager: */
@@ -75,5 +75,5 @@
     /* Other helpers: */
     void updateMenuActions(bool fWithSave);
-    quint64 memoryRequirements(const QMap<int, int> *pScreenLayout) const;
+    quint64 memoryRequirements(const QMap<int, int> &screenLayout) const;
 
     /* Variables: */
@@ -81,5 +81,5 @@
     int m_cGuestScreens;
     int m_cHostScreens;
-    QMap<int, int> *m_pScreenMap;
+    QMap<int, int> m_screenMap;
     QMenu *m_pViewMenu;
     QList<QMenu*> m_screenMenuList;
