---
 server/red_worker.c |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/server/red_worker.c b/server/red_worker.c
index 550bda9..9795dab 100644
--- a/server/red_worker.c
+++ b/server/red_worker.c
@@ -10236,15 +10236,19 @@ static inline void 
handle_dev_destroy_surface_wait(RedWorker *worker)
 {
     RedWorkerMessage message;
     uint32_t surface_id;
+    RingItem *link;
+    Surfaces *surfaces;
 
     receive_data(worker->channel, &surface_id, sizeof(uint32_t));
 
     ASSERT(surface_id == 0);
-    
+
     flush_all_qxl_commands(worker);
 
-    if (worker->surfaces.surfaces[0].context.canvas) {
-        destroy_surface_wait(worker, &worker->surfaces, 0);
+    SURFACES_FOREACH(link, surfaces, worker) {
+        if (surfaces->surfaces[0].context.canvas) {
+            destroy_surface_wait(worker, surfaces, 0);
+        }
     }
 
     message = RED_WORKER_MESSAGE_READY;
-- 
1.7.4.4

_______________________________________________
Spice-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/spice-devel

Reply via email to