]> git.vomp.tv Git - vompclient.git/commitdiff
*** empty log message ***
authorChris Tallon <chris@vomp.tv>
Thu, 16 Jul 2009 18:20:41 +0000 (18:20 +0000)
committerChris Tallon <chris@vomp.tv>
Thu, 16 Jul 2009 18:20:41 +0000 (18:20 +0000)
boxstack.cc

index 3d72fe91dbfad69f55ae1ab7f517b1af6fc1e6b7..cbf2dac8b96f9badcfbd0df78173ae93121172f0 100644 (file)
@@ -234,22 +234,29 @@ void BoxStack::update(Boxx* toUpdate, Region* regionToUpdate)
   Log::getInstance()->log("BoxStack", Log::DEBUG, "Locked for update");
 
   // Get the z index of the box
-  int z;
-  for (z = 0; z < numBoxes; z++)
+  int z = 0;
+  if (toUpdate)
   {
-    if (boxes[z] == toUpdate) break;
-  }
+    for (z = 0; z < numBoxes; z++)
+    {
+      if (boxes[z] == toUpdate) break;
+    }
 
-  if (z == numBoxes)
+    if (z == numBoxes)
+    {
+      // not a Box we have!
+  #ifndef WIN32
+      pthread_mutex_unlock(&boxLock);
+  #else
+      ReleaseMutex(boxLock);
+  #endif 
+      Log::getInstance()->log("BoxStack", Log::ERR, "Unlocked for update! box not inside boxstack");
+      return;
+    }
+  }
+  else
   {
-    // not a Box we have!
-#ifndef WIN32
-    pthread_mutex_unlock(&boxLock);
-#else
-    ReleaseMutex(boxLock);
-#endif 
-    Log::getInstance()->log("BoxStack", Log::ERR, "Unlocked for update! box not inside boxstack");
-    return;
+    toUpdate = boxes[0];
   }
 
   // get the region for the whole box, could be less than that