summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Hopf <mhopf@suse.de>2009-09-21 15:44:00 +0200
committerMatthias Hopf <mhopf@suse.de>2009-09-21 16:41:49 +0200
commit977953bf14858d17c22208c848854ddbe7e86527 (patch)
tree94f499719c681e55017edd83f3f2bc0a9a7c401c
parent55747d256d759850141e4a9c4dec965616a31dc8 (diff)
Less intrusive workaround for sporadic segfault on resume.
Hopefully fixes fdo #24010 (memleak).
-rw-r--r--hw/xfree86/modes/xf86Cursors.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/hw/xfree86/modes/xf86Cursors.c b/hw/xfree86/modes/xf86Cursors.c
index f4b8be50b..3d2d63337 100644
--- a/hw/xfree86/modes/xf86Cursors.c
+++ b/hw/xfree86/modes/xf86Cursors.c
@@ -461,10 +461,6 @@ xf86_use_hw_cursor (ScreenPtr screen, CursorPtr cursor)
xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn);
xf86CursorInfoPtr cursor_info = xf86_config->cursor_info;
- if (xf86_config->cursor == cursor) {
- xf86DrvMsg(index, X_ERROR, "Trying to set already set cursor.\n");
- return FALSE;
- }
if (xf86_config->cursor)
FreeCursor (xf86_config->cursor, None);
xf86_config->cursor = cursor;
@@ -484,12 +480,14 @@ xf86_use_hw_cursor_argb (ScreenPtr screen, CursorPtr cursor)
xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn);
xf86CursorInfoPtr cursor_info = xf86_config->cursor_info;
- if (xf86_config->cursor == cursor) {
- xf86DrvMsg(index, X_ERROR, "Trying to set already set cursor.\n");
- return FALSE;
+ if (xf86_config->cursor) {
+ /* Under some circumstances an already set cursor is set again.
+ * If the pointer is freed, ->bits is killed */
+ if (xf86_config->cursor != cursor)
+ FreeCursor (xf86_config->cursor, None);
+ else
+ --cursor->refcnt;
}
- if (xf86_config->cursor)
- FreeCursor (xf86_config->cursor, None);
xf86_config->cursor = cursor;
++cursor->refcnt;