[Spice-devel,v2,1/7] server/red_worker: don't release self_bitmap unless refcount is 0

Submitted by Alon Levy on May 15, 2012, 10:58 a.m.

Details

Message ID 1337079514-25271-2-git-send-email-alevy@redhat.com
State Accepted
Headers show

Not browsing as part of any series.

Commit Message

Alon Levy May 15, 2012, 10:58 a.m.
From: Yonit Halperin <yhalperi@redhat.com>

RHBZ: 808936
---
 server/red_worker.c |    7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

Patch hide | download patch | download mbox

diff --git a/server/red_worker.c b/server/red_worker.c
index 473d0d6..60f30d3 100644
--- a/server/red_worker.c
+++ b/server/red_worker.c
@@ -1695,13 +1695,12 @@  static inline void put_red_drawable(RedWorker *worker, RedDrawable *drawable, ui
 {
     QXLReleaseInfoExt release_info_ext;
 
-    if (self_bitmap) {
-        red_put_image(self_bitmap);
-    }
     if (--drawable->refs) {
         return;
     }
-
+    if (self_bitmap) {
+        red_put_image(self_bitmap);
+    }
     worker->red_drawable_count--;
     release_info_ext.group_id = group_id;
     release_info_ext.info = drawable->release_info;