diff options
| author | Peter Hutterer <peter.hutterer@who-t.net> | 2013-05-15 19:01:11 +1000 | 
|---|---|---|
| committer | Peter Hutterer <peter.hutterer@who-t.net> | 2013-07-17 14:37:37 +1000 | 
| commit | 1e29b269fd712ae1e3552eeddd3529015baee7ae (patch) | |
| tree | 7b665f59661b10eb95fed6257aee33c293cc16a5 /xfixes | |
| parent | c0be1168fd3dd2eb01187789ddc30d7aab909a98 (diff) | |
Abstract cursor refcounting
Too many callers relied on the refcnt being handled correctly. Use a simple
wrapper to handle that case.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit 9a5ad65330693b3273972b63d10f2907d9ab954a)
Diffstat (limited to 'xfixes')
| -rw-r--r-- | xfixes/cursor.c | 6 | 
1 files changed, 3 insertions, 3 deletions
| diff --git a/xfixes/cursor.c b/xfixes/cursor.c index 568e717fa..cc6e059b9 100644 --- a/xfixes/cursor.c +++ b/xfixes/cursor.c @@ -619,12 +619,12 @@ ReplaceCursorLookup(pointer value, XID id, pointer closure)      }      if (pCursor && pCursor != rcl->pNew) {          if ((*rcl->testCursor) (pCursor, rcl->closure)) { -            rcl->pNew->refcnt++; +            CursorPtr curs = RefCursor(rcl->pNew);              /* either redirect reference or update resource database */              if (pCursorRef) -                *pCursorRef = rcl->pNew; +                *pCursorRef = curs;              else -                ChangeResourceValue(id, RT_CURSOR, rcl->pNew); +                ChangeResourceValue(id, RT_CURSOR, curs);              FreeCursor(pCursor, cursor);          }      } | 
