summaryrefslogtreecommitdiffstats
path: root/libvncserver/cursor.c
diff options
context:
space:
mode:
Diffstat (limited to 'libvncserver/cursor.c')
-rw-r--r--libvncserver/cursor.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/libvncserver/cursor.c b/libvncserver/cursor.c
index 8e2789b..3a01e64 100644
--- a/libvncserver/cursor.c
+++ b/libvncserver/cursor.c
@@ -616,14 +616,15 @@ void rfbSetCursor(rfbScreenInfoPtr rfbScreen,rfbCursorPtr c)
LOCK(rfbScreen->cursorMutex);
- if(rfbScreen->cursor && rfbScreen->cursor->cleanup) {
+ if(rfbScreen->cursor) {
iterator=rfbGetClientIterator(rfbScreen);
while((cl=rfbClientIteratorNext(iterator)))
if(!cl->enableCursorShapeUpdates)
rfbRedrawAfterHideCursor(cl);
rfbReleaseClientIterator(iterator);
- rfbFreeCursor(rfbScreen->cursor);
+ if(rfbScreen->cursor->cleanup)
+ rfbFreeCursor(rfbScreen->cursor);
}
rfbScreen->cursor = c;