[Spice-devel] [PATCH qxl-win v2 3/8] display/res: turn two asserts in CursorCacheRemove to debug prints

Alon Levy alevy at redhat.com
Mon Jun 20 05:37:03 PDT 2011


In Free build this is defined out anyway, but in checked build this assert
triggers, so change it to a debug print (pending investigation on why
someone thought at some point it should never happen).

The asserts were on:
 cursor->unique != 0
 function end not reached
---
 display/res.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/display/res.c b/display/res.c
index 5dc6e10..1b8cf84 100644
--- a/display/res.c
+++ b/display/res.c
@@ -2778,7 +2778,10 @@ static void CursorCacheRemove(PDev *pdev, InternalCursor *cursor)
 
     DEBUG_PRINT((pdev, 12, "%s\n", __FUNCTION__));
 
-    ASSERT(pdev, cursor->unique);
+    if (!cursor->unique) {
+        DEBUG_PRINT((pdev, 1, "%s: cursor not unique\n", __FUNCTION__));
+        return;
+    }
     internal = &pdev->Res->cursor_cache[CURSOR_HASH_VAL(cursor->hsurf)];
 
     while (*internal) {
@@ -2794,7 +2797,7 @@ static void CursorCacheRemove(PDev *pdev, InternalCursor *cursor)
         }
         internal = &(*internal)->next;
     }
-    ASSERT(pdev, FALSE);
+    DEBUG_PRINT((pdev, 0, "%s: Error: should not reach this\n", __FUNCTION__));
 }
 
 static void CursorCacheAdd(PDev *pdev, InternalCursor *cursor)
-- 
1.7.5.4



More information about the Spice-devel mailing list