Index: /trunk/src/VBox/Frontends/VirtualBox/src/VBoxFBOverlay.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/VBoxFBOverlay.cpp	(revision 49939)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/VBoxFBOverlay.cpp	(revision 49940)
@@ -212,6 +212,4 @@
 };
 
-static VBoxVHWAEntriesCache g_VBoxCmdEntriesCache;
-
 static struct VBOXVHWACMD * vhwaHHCmdCreate(VBOXVHWACMD_TYPE type, size_t size)
 {
@@ -312,5 +310,5 @@
     {
         /* @todo: resize */
-        Assert(0);
+        AssertFailed();
     }
 
@@ -334,5 +332,5 @@
     }
 
-    Assert(0);
+    AssertFailed();
     return VBOXVHWA_SURFHANDLE_INVALID;
 }
@@ -486,5 +484,5 @@
     if (!fi.open(QIODevice::ReadOnly))
     {
-        Assert(0);
+        AssertFailed();
         return VERR_GENERAL_FAILURE;
     }
@@ -920,5 +918,5 @@
                     break;
                 default:
-                    Assert(0);
+                    AssertFailed();
                     break;
             }
@@ -958,5 +956,5 @@
         return VINF_SUCCESS;
 
-    Assert(0);
+    AssertFailed();
     VBoxVHWAGlProgram::uninit();
     return VERR_GENERAL_FAILURE;
@@ -1107,5 +1105,5 @@
     if(type & VBOXVHWA_PROGRAM_SRCCOLORKEY)
     {
-        Assert(0);
+        AssertFailed();
         /* disabled for now, not really necessary for video overlaying */
     }
@@ -1360,5 +1358,5 @@
         break;
     default:
-        Assert(0);
+        AssertFailed();
         break;
     }
@@ -1382,5 +1380,5 @@
         break;
     default:
-        Assert(0);
+        AssertFailed();
         break;
     }
@@ -1566,5 +1564,5 @@
     VBOXQGLDBGPRINT(("<?dml?><exec cmd=\"!vbvdbg.ms 0x%p 0n%d 0n%d\">texture info</exec>\n",
             pvBuf, mRect.width(), mRect.height()));
-    Assert(0);
+    AssertFailed();
 
     free(pvBuf);
@@ -2205,5 +2203,5 @@
     if(!(pCmd->SurfInfo.flags & VBOXVHWA_SD_CAPS))
     {
-        Assert(0);
+        AssertFailed();
         pCmd->u.out.ErrInfo = -1;
         return VINF_SUCCESS;
@@ -2213,5 +2211,5 @@
     {
 #ifdef DEBUGVHWASTRICT
-        Assert(0);
+        AssertFailed();
 #endif
         pCmd->u.out.ErrInfo = -1;
@@ -2225,5 +2223,5 @@
         {
 #ifdef DEBUG_misha
-            Assert(0);
+            AssertFailed();
 #endif
             pCmd->u.out.ErrInfo = -1;
@@ -2240,5 +2238,5 @@
     {
 #ifdef DEBUGVHWASTRICT
-        Assert (0);
+        AssertFailed();
 #endif
         pCmd->u.out.ErrInfo = -1;
@@ -2251,5 +2249,5 @@
         if (!(pCmd->SurfInfo.flags & VBOXVHWA_SD_PIXELFORMAT))
         {
-            Assert (0);
+            AssertFailed();
             pCmd->u.out.ErrInfo = -1;
             return VINF_SUCCESS;
@@ -2261,5 +2259,5 @@
                     || pCmd->SurfInfo.PixelFormat.c.rgbBitCount != 24)
             {
-                Assert (0);
+                AssertFailed();
                 pCmd->u.out.ErrInfo = -1;
                 return VINF_SUCCESS;
@@ -2285,5 +2283,5 @@
         else
         {
-            Assert (0);
+            AssertFailed();
             pCmd->u.out.ErrInfo = -1;
             return VINF_SUCCESS;
@@ -2305,5 +2303,5 @@
         if(mSurfHandleTable.get(handle))
         {
-            Assert(0);
+            AssertFailed();
             return VERR_GENERAL_FAILURE;
         }
@@ -3231,5 +3229,5 @@
         else
         {
-            Assert(0);
+            AssertFailed();
         }
 
@@ -3791,10 +3789,10 @@
             case 24:
 #ifdef DEBUG_misha
-                Assert(0);
+                AssertFailed();
 #endif
                 break;
             case 8:
 #ifdef DEBUG_misha
-                Assert(0);
+                AssertFailed();
 #endif
                 g = b = 0;
@@ -3803,5 +3801,5 @@
             case 1:
 #ifdef DEBUG_misha
-                Assert(0);
+                AssertFailed();
 #endif
                 r = 1;
@@ -3811,5 +3809,5 @@
             default:
 #ifdef DEBUG_misha
-                Assert(0);
+                AssertFailed();
 #endif
                 remind = true;
@@ -4027,5 +4025,5 @@
             break;
         default:
-            Assert(0);
+            AssertFailed();
             mBitsPerPixel = 0;
             mBitsPerPixelTex = 0;
@@ -4052,5 +4050,5 @@
         case 24:
 #ifdef DEBUG_misha
-            Assert(0);
+            AssertFailed();
 #endif
             mInternalFormat = 3;//GL_RGB;
@@ -4063,5 +4061,5 @@
         case 16:
 #ifdef DEBUG_misha
-            Assert(0);
+            AssertFailed();
 #endif
             mInternalFormat = GL_RGB5;
@@ -4074,5 +4072,5 @@
         case 8:
 #ifdef DEBUG_misha
-            Assert(0);
+            AssertFailed();
 #endif
             mInternalFormat = 1;//GL_RGB;
@@ -4083,5 +4081,5 @@
         case 1:
 #ifdef DEBUG_misha
-            Assert(0);
+            AssertFailed();
 #endif
             mInternalFormat = 1;
@@ -4092,5 +4090,5 @@
         default:
 #ifdef DEBUG_misha
-            Assert(0);
+            AssertFailed();
 #endif
             mBitsPerPixel = 0;
@@ -4824,5 +4822,5 @@
 #endif
         default:
-            Assert(0);
+            AssertFailed();
             pCmd->rc = VERR_NOT_IMPLEMENTED;
             break;
@@ -4945,5 +4943,5 @@
 #endif
         default:
-            Assert(0);
+            AssertFailed();
     }
 }
@@ -4959,4 +4957,6 @@
 
     RTListInit(&mCommandList);
+
+    m_pCmdEntryCache = new VBoxVHWAEntriesCache;
 }
 
@@ -4967,4 +4967,6 @@
 
     RTCritSectDelete(&mCritSect);
+
+    delete m_pCmdEntryCache;
 }
 
@@ -4978,5 +4980,5 @@
     RTCritSectEnter(&mCritSect);
 
-    VBoxVHWACommandElement * pCmd = g_VBoxCmdEntriesCache.alloc();
+    VBoxVHWACommandElement * pCmd = m_pCmdEntryCache->alloc();
     if(!pCmd)
     {
@@ -5079,5 +5081,5 @@
 
     if (pEl)
-        g_VBoxCmdEntriesCache.free(pEl);
+        m_pCmdEntryCache->free(pEl);
 }
 
@@ -5173,5 +5175,5 @@
         case VBOXVHWA_PIPECMD_FUNC:
             /* should not happen, don't handle this for now */
-            Assert(0);
+            AssertFailed();
             break;
 #endif
@@ -5180,10 +5182,10 @@
         default:
             /* should not happen, don't handle this for now */
-            Assert(0);
+            AssertFailed();
             break;
         }
 
         RTListNodeRemove(&pCur->ListNode);
-        g_VBoxCmdEntriesCache.free(pCur);
+        m_pCmdEntryCache->free(pCur);
     }
 
@@ -5260,5 +5262,5 @@
                         }
                         default:
-                            Assert(0);
+                            AssertFailed();
                             break;
                     }
@@ -5306,5 +5308,5 @@
             }
             default:
-                Assert(0);
+                AssertFailed();
                 break;
         }
Index: /trunk/src/VBox/Frontends/VirtualBox/src/VBoxFBOverlay.h
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/VBoxFBOverlay.h	(revision 49939)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/VBoxFBOverlay.h	(revision 49940)
@@ -1307,4 +1307,5 @@
 };
 
+class VBoxVHWAEntriesCache;
 class VBoxVHWACommandElementProcessor
 {
@@ -1331,4 +1332,5 @@
     bool mbResetting;
     uint32_t mcDisabled;
+    VBoxVHWAEntriesCache *m_pCmdEntryCache;
 };
 
