@@ -336,6 +336,7 @@ int qxl_render_cursor(PCIQXLDevice *qxl, QXLCommandExt *ext)
}
qemu_mutex_lock(&qxl->ssd.lock);
if (qxl->ssd.cursor) {
+ // other thread
cursor_unref(qxl->ssd.cursor);
}
qxl->ssd.cursor = c;
@@ -985,8 +985,10 @@ void dpy_cursor_define(QemuConsole *c, QEMUCursor *cursor)
DisplayState *s = c->ds;
DisplayChangeListener *dcl;
+ //lock, main thread
cursor_unref(con->cursor);
con->cursor = cursor_ref(cursor);
+ //unlock
if (!qemu_console_is_visible(c)) {
return;
}