[Spice-devel] [RFC v4 49/62] server/red_worker: handle_dev_destroy_primary_surface: clear all primary copies

Alon Levy alevy at redhat.com
Tue Apr 26 03:55:14 PDT 2011


---
 server/red_worker.c |   13 ++++++++-----
 1 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/server/red_worker.c b/server/red_worker.c
index ca59662..5fb8a5f 100644
--- a/server/red_worker.c
+++ b/server/red_worker.c
@@ -10357,7 +10357,8 @@ static inline void handle_dev_destroy_primary_surface(RedWorker *worker)
 {
     RedWorkerMessage message;
     uint32_t surface_id;
-    Surfaces *surfaces = &worker->surfaces;
+    Surfaces *surfaces;
+    RingItem *link;
     RedChannel *cursor_red_channel = &worker->cursor_channel->common.base;
 
     receive_data(worker->channel, &surface_id, sizeof(uint32_t));
@@ -10380,11 +10381,13 @@ static inline void handle_dev_destroy_primary_surface(RedWorker *worker)
     }
 
     flush_all_qxl_commands(worker);
-    destroy_surface_wait(worker, surfaces, 0);
-    red_destroy_surface(worker, surfaces, 0);
-    ASSERT(ring_is_empty(&surfaces->streams));
+    SURFACES_FOREACH(link, surfaces, worker) {
+        destroy_surface_wait(worker, surfaces, 0);
+        red_destroy_surface(worker, surfaces, 0);
+        ASSERT(ring_is_empty(&surfaces->streams));
+    }
 
-    ASSERT(!surfaces->surfaces[surface_id].context.canvas);
+    ASSERT(!worker->surfaces.surfaces[surface_id].context.canvas);
 
     worker->cursor_visible = TRUE;
     worker->cursor_position.x = worker->cursor_position.y = 0;
-- 
1.7.4.4



More information about the Spice-devel mailing list